patch 2-1
This commit is contained in:
parent
72c070ff4f
commit
b64ecd0133
@ -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',
|
||||||
|
|||||||
@ -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:
|
||||||
|
|||||||
@ -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:
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
@ -40,7 +39,7 @@ ch.setFormatter(formatter)
|
|||||||
logger.addHandler(fh)
|
logger.addHandler(fh)
|
||||||
logger.addHandler(ch)
|
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:
|
for ext in extensions:
|
||||||
bot.load_extension(ext)
|
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'))
|
await bot.change_presence(game=discord.Game(name=f'V2 IS HERE >> pm!help'))
|
||||||
|
|
||||||
# check discord server configs
|
# check discord server configs
|
||||||
db_server_ids = [entry['_id'] async for entry in bot.db.config.find({}, {})]
|
try:
|
||||||
for server in bot.servers:
|
db_server_ids = [entry['_id'] async for entry in bot.db.config.find({}, {})]
|
||||||
if server.id not in db_server_ids:
|
for server in bot.servers:
|
||||||
# create new config entry
|
if server.id not in db_server_ids:
|
||||||
await bot.db.config.update_one(
|
# create new config entry
|
||||||
{'_id': str(server.id)},
|
await bot.db.config.update_one(
|
||||||
{'$set': {'prefix': 'pm!', 'admin_role': 'polladmin', 'user_role': 'polluser'}},
|
{'_id': str(server.id)},
|
||||||
upsert=True
|
{'$set': {'prefix': 'pm!', 'admin_role': 'polladmin', 'user_role': 'polluser'}},
|
||||||
)
|
upsert=True
|
||||||
import_old_database(bot, server)
|
)
|
||||||
print(str(server), "updated.")
|
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
|
@bot.event
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user