Skip to content

Commit

Permalink
Poll added
Browse files Browse the repository at this point in the history
  • Loading branch information
Mastermind-sap committed Apr 17, 2021
1 parent e287d2a commit 4f7549b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Binary file modified cogs/__pycache__/utility.cpython-38.pyc
Binary file not shown.
12 changes: 12 additions & 0 deletions cogs/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,17 @@ async def quote(self,ctx):
async def randomfact(self,ctx):
await ctx.send(randfacts.getFact())

@commands.command()
async def server_poll(self,ctx, emojis: commands.Greedy[discord.Emoji], *, text):
msg = await ctx.send(text)
for emoji in emojis:
await msg.add_reaction(emoji)

@commands.command()
async def poll(self,ctx, *, text):
message = await ctx.send(text)
for emoji in ('👍', '👎'):
await message.add_reaction(emoji)

def setup(bot):
bot.add_cog(Utility(bot))
14 changes: 7 additions & 7 deletions joker.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ async def reload(ctx,extension):
async def loadall(ctx):
try:
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
bot.load_extension(f"cogs.{filename[:-3]}")
if filename.endswith(".py"):
bot.load_extension(f"cogs.{filename[:-3]}")
await ctx.send(f"Loaded all")
except Exception as e:
await ctx.send("Error occured:"+e)
Expand All @@ -76,8 +76,8 @@ async def loadall(ctx):
async def unloadall(ctx):
try:
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
bot.unload_extension(f"cogs.{filename[:-3]}")
if filename.endswith(".py"):
bot.unload_extension(f"cogs.{filename[:-3]}")
await ctx.send(f"Unloaded all")
except Exception as e:
await ctx.send("Error occured:"+e)
Expand All @@ -87,9 +87,9 @@ async def unloadall(ctx):
async def reloadall(ctx):
try:
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
bot.unload_extension(f"cogs.{filename[:-3]}")
bot.load_extension(f"cogs.{filename[:-3]}")
if filename.endswith(".py"):
bot.unload_extension(f"cogs.{filename[:-3]}")
bot.load_extension(f"cogs.{filename[:-3]}")
await ctx.send(f"Reloaded all")
except Exception as e:
await ctx.send("Error occured:"+e)
Expand Down

0 comments on commit 4f7549b

Please sign in to comment.