aboutsummaryrefslogtreecommitdiff
path: root/cogs/general.py
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2020-06-02 07:29:45 +0000
committerAnInternetTroll <lucafulger@gmail.com>2020-06-02 07:29:45 +0000
commit29921b0d9a5a5a719669c4772dcafa4ab3c786e1 (patch)
tree2621ffc4d3fc9659ce22fbf873c4cf463f6b872c /cogs/general.py
parentd7d868a43adb2bd3f89b4400288a397960e85769 (diff)
downloadsteve-bot-29921b0d9a5a5a719669c4772dcafa4ab3c786e1.tar
steve-bot-29921b0d9a5a5a719669c4772dcafa4ab3c786e1.tar.gz
steve-bot-29921b0d9a5a5a719669c4772dcafa4ab3c786e1.tar.bz2
steve-bot-29921b0d9a5a5a719669c4772dcafa4ab3c786e1.tar.lz
steve-bot-29921b0d9a5a5a719669c4772dcafa4ab3c786e1.tar.xz
steve-bot-29921b0d9a5a5a719669c4772dcafa4ab3c786e1.tar.zst
steve-bot-29921b0d9a5a5a719669c4772dcafa4ab3c786e1.zip
modified: .gitignore
modified: .vscode/settings.json modified: bot.py modified: cogs/admin.py modified: cogs/general.py modified: cogs/help.py modified: cogs/player.py modified: cogs/src.py modified: cogs/trans.py modified: cogs/utils.py modified: custom_commands.json modified: main.py
Diffstat (limited to '')
-rwxr-xr-x[-rw-r--r--]cogs/general.py130
1 files changed, 73 insertions, 57 deletions
diff --git a/cogs/general.py b/cogs/general.py
index 091c325..ff60bb7 100644..100755
--- a/cogs/general.py
+++ b/cogs/general.py
@@ -1,57 +1,73 @@
-from discord.ext import commands
-import discord
-import datetime
-
-def dump(obj):
- output = ""
- for attr in dir(obj):
- output += "\nobj.%s = %r" % (attr, getattr(obj, attr))
- print("obj.%s = %r" % (attr, getattr(obj, attr)))
- return output
-
-
-class General(commands.Cog):
- def __init__(self, bot):
- self.bot = bot
-
- @commands.command()
- async def userinfo(self, ctx, user: discord.Member=None):
- #await ctx.send(f"```py\n{dump(user)}```")
-
- if not user:
- user = ctx.message.author
- elif type(user)=="str":
- user = self.bot.get_user(int(user))
-
- # Very very shit
- """
- await ctx.send(str(user.avatar_url))
- request.urlretrieve(str(user.avatar_url), "temp.webp")
- #filename = wget.download(user.avatar_url, out="temp.webp")
- image = Image.open("temp.webp").convert("RGB")
- image.save("temp.png", "PNG")
-
- f = discord.File("temp.png", filename="temp.png")
- #await messagable.send(file=f, embed=e)
- """
- output = ""
- for i in user.roles:
- output += i.mention
-
-
- embed=discord.Embed(title=user.name, description=user.mention, color=user.color, timestamp=ctx.message.created_at)
- #embed.set_thumbnail(url="attachment://temp.webp")
- embed.set_thumbnail(url=user.avatar_url)
- embed.set_image(url="attachment://temp.png")
- embed.add_field(name="Nickname", value=user.display_name, inline=False)
- embed.add_field(name="Joined on", value=user.joined_at.date(), inline=True)
- embed.add_field(name="Status", value=user.status, inline=True)
- embed.add_field(name="Created account on", value=user.created_at.date(), inline=True)
- embed.add_field(name="Roles", value=output, inline=True)
- embed.set_footer(text=f"ID: {user.id}")
- await ctx.send(embed=embed)
- #os.remove("temp.webp")
- #os.remove("temp.png")
-
-def setup(bot):
- bot.add_cog(General(bot))
+from discord.ext import commands
+import discord
+import datetime
+
+def dump(obj):
+ output = ""
+ for attr in dir(obj):
+ output += "\nobj.%s = %r" % (attr, getattr(obj, attr))
+ print("obj.%s = %r" % (attr, getattr(obj, attr)))
+ return output
+
+
+class General(commands.Cog):
+ def __init__(self, bot):
+ self.bot = bot
+
+ @commands.command()
+ async def userinfo(self, ctx, user: discord.Member=None):
+ #await ctx.send(f"```py\n{dump(user)}```")
+
+ if not user:
+ user = ctx.message.author
+ elif type(user)=="str":
+ user = self.bot.get_user(int(user))
+
+ # Very very shit
+ """
+ await ctx.send(str(user.avatar_url))
+ request.urlretrieve(str(user.avatar_url), "temp.webp")
+ #filename = wget.download(user.avatar_url, out="temp.webp")
+ image = Image.open("temp.webp").convert("RGB")
+ image.save("temp.png", "PNG")
+
+ f = discord.File("temp.png", filename="temp.png")
+ #await messagable.send(file=f, embed=e)
+ """
+ output = ""
+ for i in user.roles:
+ output += i.mention
+
+
+ embed=discord.Embed(title=user.name, description=user.mention, color=user.color, timestamp=ctx.message.created_at)
+ #embed.set_thumbnail(url="attachment://temp.webp")
+ embed.set_thumbnail(url=user.avatar_url)
+ embed.set_image(url="attachment://temp.png")
+ embed.add_field(name="Nickname", value=user.display_name, inline=False)
+ embed.add_field(name="Joined on", value=user.joined_at.date(), inline=True)
+ embed.add_field(name="Status", value=user.status, inline=True)
+ embed.add_field(name="Created account on", value=user.created_at.date(), inline=True)
+ embed.add_field(name="Roles", value=output, inline=True)
+ embed.set_footer(text=f"ID: {user.id}")
+ await ctx.send(embed=embed)
+ #os.remove("temp.webp")
+ #os.remove("temp.png")
+
+ @commands.command()
+ async def coop(self, ctx, user: discord.Member=None):
+ if not user:
+ user = ctx.message.author
+ elif type(user)=="str":
+ user = self.bot.get_user(int(user))
+
+ coop_role = ctx.guild.get_role(694261282861219952)
+
+ if coop_role in user.roles:
+ await user.remove_roles(coop_role)
+ await ctx.send('You have left coop gang')
+ else:
+ await user.add_roles(coop_role)
+ await ctx.send("You are now in the coop gang")
+
+def setup(bot):
+ bot.add_cog(General(bot))