patch 2-1

This commit is contained in:
matnad 2019-02-11 17:34:15 +01:00
parent 72c070ff4f
commit b64ecd0133
4 changed files with 24 additions and 21 deletions

View File

@ -49,7 +49,7 @@ class Help:
if page == '🏠': if page == '🏠':
## POLL CREATION SHORT ## POLL CREATION SHORT
embed.add_field(name='🆕 Making New Polls', 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='Commands', value=f'`{pre}quick` | `{pre}new` | `{pre}prepared`', inline=False)
# embed.add_field(name='Arguments', value=f'Arguments: `<poll question>` (optional)', inline=False) # embed.add_field(name='Arguments', value=f'Arguments: `<poll question>` (optional)', inline=False)
# embed.add_field(name='Examples', value=f'Examples: `{pre}new` | `{pre}quick What is the greenest color?`', # 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) inline=False)
embed.add_field(name='🔹 **Support Server**', embed.add_field(name='🔹 **Support Server**',
value='If you need help with pollmaster, want to try him out or would like to give feedback ' 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) inline=False)
embed.add_field(name='🔹 **Github**', embed.add_field(name='🔹 **Github**',
value='The full python source code is on my Github: https://github.com/matnad/pollmaster', value='The full python source code is on my Github: https://github.com/matnad/pollmaster',

View File

@ -254,7 +254,7 @@ class Poll:
except InputError: except InputError:
pass 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 " "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" "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` ") "Examples: `in 2 days`, `next week CET`, `may 3rd 2019`, `9.11.2019 9pm EST` ")
@ -419,7 +419,7 @@ class Poll:
elif number == 3: elif number == 3:
return ['😍', '👍', '🤐', '👎', '🤢'] return ['😍', '👍', '🤐', '👎', '🤢']
elif number == 4: elif number == 4:
return ['in favour', 'against', 'abstain'] return ['in favour', 'against', 'abstaining']
try: try:

View File

@ -74,10 +74,6 @@ class PollControls:
# Activate Poll # Activate Poll
p.active = True 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 p.save_to_db()
await ctx.invoke(self.show, short) await ctx.invoke(self.show, short)
else: else:

View File

@ -3,7 +3,6 @@ import logging
import aiohttp import aiohttp
import discord import discord
from discord.ext import commands from discord.ext import commands
from motor.motor_asyncio import AsyncIOMotorClient from motor.motor_asyncio import AsyncIOMotorClient
@ -56,6 +55,7 @@ async def on_ready():
await bot.change_presence(game=discord.Game(name=f'V2 IS HERE >> pm!help')) await bot.change_presence(game=discord.Game(name=f'V2 IS HERE >> pm!help'))
# check discord server configs # check discord server configs
try:
db_server_ids = [entry['_id'] async for entry in bot.db.config.find({}, {})] db_server_ids = [entry['_id'] async for entry in bot.db.config.find({}, {})]
for server in bot.servers: for server in bot.servers:
if server.id not in db_server_ids: if server.id not in db_server_ids:
@ -65,8 +65,15 @@ async def on_ready():
{'$set': {'prefix': 'pm!', 'admin_role': 'polladmin', 'user_role': 'polluser'}}, {'$set': {'prefix': 'pm!', 'admin_role': 'polladmin', 'user_role': 'polluser'}},
upsert=True upsert=True
) )
import_old_database(bot, server) try:
await import_old_database(bot, server)
print(str(server), "updated.") print(str(server), "updated.")
except:
print(str(server.id), "failed.")
except:
print("Problem verifying servers.")
print("Servers verified. Bot running.")
@bot.event @bot.event