diff --git a/cogs/help.py b/cogs/help.py index 3f69e00..bed434d 100644 --- a/cogs/help.py +++ b/cogs/help.py @@ -49,7 +49,7 @@ class Help: if page == '🏠': ## POLL CREATION SHORT embed.add_field(name='🆕 Making New Polls', - value=f'`{pre}quick` | `{pre}new` | `{pre}prepared`', inline=False) + value=f'`{pre}quick` | `{pre}new` | `{pre}prepare`', inline=False) # embed.add_field(name='Commands', value=f'`{pre}quick` | `{pre}new` | `{pre}prepared`', inline=False) # embed.add_field(name='Arguments', value=f'Arguments: `` (optional)', inline=False) # embed.add_field(name='Examples', value=f'Examples: `{pre}new` | `{pre}quick What is the greenest color?`', @@ -183,7 +183,7 @@ class Help: inline=False) embed.add_field(name='🔹 **Support Server**', value='If you need help with pollmaster, want to try him out or would like to give feedback ' - 'to the developer, feel free to join the support server: ', + 'to the developer, feel free to join the support server: https://discord.gg/Vgk8Nve', inline=False) embed.add_field(name='🔹 **Github**', value='The full python source code is on my Github: https://github.com/matnad/pollmaster', diff --git a/cogs/poll.py b/cogs/poll.py index c7c85e5..226a4c2 100644 --- a/cogs/poll.py +++ b/cogs/poll.py @@ -254,7 +254,7 @@ class Poll: except InputError: pass - text = ("This poll will we created inactive. You can either schedule activation at a certain date or activate " + text = ("This poll will be created inactive. You can either schedule activation at a certain date or activate " "it manually. **Type `0` to activate it manually or tell me when you want to activate it** by " "typing an absolute or relative date. You can specify a timezone if you want.\n" "Examples: `in 2 days`, `next week CET`, `may 3rd 2019`, `9.11.2019 9pm EST` ") @@ -419,7 +419,7 @@ class Poll: elif number == 3: return ['😍', '👍', '🤐', '👎', '🤢'] elif number == 4: - return ['in favour', 'against', 'abstain'] + return ['in favour', 'against', 'abstaining'] try: diff --git a/cogs/poll_controls.py b/cogs/poll_controls.py index 0a535be..1c56298 100644 --- a/cogs/poll_controls.py +++ b/cogs/poll_controls.py @@ -74,10 +74,6 @@ class PollControls: # Activate Poll p.active = True - if p.duration_type == 'timespan': - # add the the time between creation and activation to the duration - # -> "restart" the duration - p.duration += (p.get_activation_date() - p.time_created) / 60 await p.save_to_db() await ctx.invoke(self.show, short) else: diff --git a/pollmaster.py b/pollmaster.py index 9108f37..1c14366 100644 --- a/pollmaster.py +++ b/pollmaster.py @@ -3,7 +3,6 @@ import logging import aiohttp import discord - from discord.ext import commands from motor.motor_asyncio import AsyncIOMotorClient @@ -40,7 +39,7 @@ ch.setFormatter(formatter) logger.addHandler(fh) logger.addHandler(ch) -extensions = ['cogs.config','cogs.poll_controls', 'cogs.help', 'cogs.db_api'] +extensions = ['cogs.config', 'cogs.poll_controls', 'cogs.help', 'cogs.db_api'] for ext in extensions: bot.load_extension(ext) @@ -56,17 +55,25 @@ async def on_ready(): await bot.change_presence(game=discord.Game(name=f'V2 IS HERE >> pm!help')) # check discord server configs - db_server_ids = [entry['_id'] async for entry in bot.db.config.find({}, {})] - for server in bot.servers: - if server.id not in db_server_ids: - # create new config entry - await bot.db.config.update_one( - {'_id': str(server.id)}, - {'$set': {'prefix': 'pm!', 'admin_role': 'polladmin', 'user_role': 'polluser'}}, - upsert=True - ) - import_old_database(bot, server) - print(str(server), "updated.") + try: + db_server_ids = [entry['_id'] async for entry in bot.db.config.find({}, {})] + for server in bot.servers: + if server.id not in db_server_ids: + # create new config entry + await bot.db.config.update_one( + {'_id': str(server.id)}, + {'$set': {'prefix': 'pm!', 'admin_role': 'polladmin', 'user_role': 'polluser'}}, + upsert=True + ) + try: + await import_old_database(bot, server) + print(str(server), "updated.") + except: + print(str(server.id), "failed.") + except: + print("Problem verifying servers.") + + print("Servers verified. Bot running.") @bot.event