Code Monkey home page Code Monkey logo

democraciv-discord-bot's People

Contributors

jonasbohmann avatar thegreatcookiemachine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

democraciv-discord-bot's Issues

Bot crashes when -addparty or -deleteparty is run

Whenever I run the -addparty or -deleteparty commands, the bot crashes.

Seems like it's an issue with the asynchronous await in config.py. I'll investigate this and leave this issue open to document it.

Traceback:

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x758a87b0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x75621880>, 361305.431396705)]']
connector: <aiohttp.connector.TCPConnector object at 0x758a8450>
task was destroyed but it is pending!
task: <Task pending coro=<DiscordWebSocket.close_connection() running at /usr/local/lib/python3.7/site-packages/discord/gateway.py:539> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x75743550>()]> cb=[shield.<locals>._done_callback() at /usr/local/lib/python3.7/asyncio/tasks.py:776]>
Exception ignored in: <coroutine object DiscordWebSocket.close_connection at 0x7573ebb8>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/discord/gateway.py", line 539, in close_connection
  File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 855, in close_connection
  File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 880, in wait_for_connection_lost
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 400, in wait_for
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 657, in call_later
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 667, in call_at
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 480, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending coro=<Client._run_event() running at /usr/local/lib/python3.7/site-packages/discord/client.py:227> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x75873950>()]>>
Task was destroyed but it is pending!
task: <Task pending coro=<BotBase.close() running at /usr/local/lib/python3.7/site-packages/discord/ext/commands/bot.py:208> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x74d40fb0>()]> cb=[Client._do_cleanup.<locals>.when_future_is_done() at /usr/local/lib/python3.7/site-packages/discord/client.py:498]>

Bot Functionality Idea

I have noticed that sometimes people will reference parties by acronyms (ie MPN instead of Monarchist Party of Norway) or forget spaces (ie Cloud9 instead of Cloud 9). My idea is that we introduce 3 new commands:

  1. -addpartyalias: Creates a new party alias
  2. -removepartyalias: Removes a party alias
  3. -listpartyalias: Lists a parties name and all aliases

The first two commands would be referenced like so -<command name> <party name>, <alias> with the first simply having the party name or a related alias. For the sake of simplicity we can also make the capwordParties aliases which are automatically defined upon creating a party.

These aliases would be used as alternatives to actual party names. For example if MPN was an alias of Monarchist Party of Norway, -join MPN would add the user to the Monarchist Party of Norway.

If you think the idea sounds good I can try to get started on it next week, however I am having my wisdom teeth removed tomorrow and am not sure when I will be able to start coding again. In addition to this just over a week after I am traveling without a computer. If I am not able to get it done next week I can work on it early September.

-leg pass multiple bills

It would be a useful feature for the Speaker to be able to mark multiple bills as passed with one use of -leg pass.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.