Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0 fixes #192

Merged
merged 5 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,7 @@ dmypy.json
# Pyre type checker
.pyre/

.idea
.idea

# Extensions
.history/
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ async def whosthatpokemon(self, ctx):
answer = wtp.name.lower()

e = Embed(title='Who\'s That Pokemon?', timestamp=ctx.message.created_at)
e.set_footer(text=f'{ctx.message.author} reply within 30secs to answer.', icon_url=ctx.message.author.avatar_url)
e.set_footer(text=f'{ctx.message.author} reply within 30secs to answer.', icon_url=ctx.message.author.avatar.url)
e.set_image(url=question)

question_message = await ctx.send('You have 3 chances, **Chance: 1/3**',embed=e)
Expand Down
22 changes: 11 additions & 11 deletions minato_namikaze/bot_files/cogs/events/bot_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def on_member_join(self, member):
embed.set_image(url='https://i.imgur.com/mktY446.jpeg')
embed.set_thumbnail(url='https://i.imgur.com/SizgkEZ.png')
embed.set_author(name=self.bot.user.name,
icon_url=self.bot.user.avatar_url)
icon_url=self.bot.user.avatar.url)
embed.set_footer(text=f"Welcome {member.name}")

e = Embed(
Expand Down Expand Up @@ -122,10 +122,10 @@ async def on_guild_join(self, guild):
)
e.set_author(
name=self.bot.user,
icon_url=self.bot.user.avatar_url
icon_url=self.bot.user.avatar.url
)
e.set_thumbnail(
url=self.bot.user.avatar_url
url=self.bot.user.avatar.url
)
e.set_image(
url=f"attachment://{img}"
Expand All @@ -139,9 +139,9 @@ async def on_guild_join(self, guild):
e34 = discord.Embed(title=f'{guild.name}',
color=discord.Color.green(), description='Added')
if guild.icon:
e34.set_thumbnail(url=guild.icon_url)
e34.set_thumbnail(url=guild.icon.url)
if guild.banner:
e34.set_image(url=guild.banner_url_as(format="png"))
e34.set_image(url=guild.banner.with_format("png").url)
c = self.bot.get_channel(
813954921782706227) if not self.bot.local else self.bot.get_channel(869238107524968479)
e34.add_field(name='**Total Members**', value=guild.member_count)
Expand All @@ -161,9 +161,9 @@ async def on_guild_remove(self, guild):
try:
e34 = ErrorEmbed(title=f'{guild.name}', description='Left')
if guild.icon:
e34.set_thumbnail(url=guild.icon_url)
e34.set_thumbnail(url=guild.icon.url)
if guild.banner:
e34.set_image(url=guild.banner_url_as(format="png"))
e34.set_image(url=guild.banner.with_format("png").url)
c = self.bot.get_channel(
813954921782706227) if not self.bot.local else self.bot.get_channel(869238107524968479)
e34.add_field(name='**Total Members**', value=guild.member_count)
Expand Down Expand Up @@ -197,8 +197,8 @@ async def on_member_ban(self, guild, user):
value=event.user, inline=True)
if event.reason:
e.add_field(name='**Reason** :', value=event.reason)
if user.avatar_url:
e.set_thumbnail(url=user.avatar_url)
if user.avatar.url:
e.set_thumbnail(url=user.avatar.url)
await ban.send(embed=e)
try:
await user.send(f'You were **banned** from **{guild.name}**', embed=e)
Expand All @@ -219,8 +219,8 @@ async def on_member_unban(self, guild, user):
title='**Unban** :tada:',
description=f'**{user.mention}** was unbanned! :tada:'
)
if user.avatar_url:
e.set_thumbnail(url=user.avatar_url)
if user.avatar.url:
e.set_thumbnail(url=user.avatar.url)
e.add_field(name='**Unbanned User** :', value=user, inline=True)
if event:
e.add_field(name='**Responsible Moderator** :',
Expand Down
6 changes: 3 additions & 3 deletions minato_namikaze/bot_files/cogs/events/cmd_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ async def on_command_error(self, ctx, error):
return
c = self.bot.get_channel(830366314761420821)

haaha = ctx.author.avatar_url
haaha = ctx.author.avatar.url
e9 = ErrorEmbed(
title="Oh no there was some error", description=f"`{error}`")
e9.add_field(name="**Command Error Caused By**",
Expand All @@ -238,9 +238,9 @@ async def on_command_error(self, ctx, error):
e = Embed(
title=f'In **{ctx.guild.name}**', description=f'User affected {ctx.message.author}')
if ctx.guild.icon:
e.set_thumbnail(url=ctx.guild.icon_url)
e.set_thumbnail(url=ctx.guild.icon.url)
if ctx.guild.banner:
e.set_image(url=ctx.guild.banner_url_as(format="png"))
e.set_image(url=ctx.guild.banner.with_format("png").url)
e.add_field(name='**Total Members**', value=ctx.guild.member_count)
e.add_field(
name='**Bots**', value=sum(1 for member in ctx.guild.members if member.bot))
Expand Down
2 changes: 1 addition & 1 deletion minato_namikaze/bot_files/cogs/events/votes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def hasvoted(self, ctx, member: Optional[Union[int, discord.Member]] = Non
title=f'{member.display_name} vote stats for me',
description=f'{member.mention} here your voting stats for last 12hours'
)
e.set_thumbnail(url=member.avatar_url)
e.set_thumbnail(url=member.avatar.url)
a = requests.get(
f'https://top.gg/api/bots/{self.bot.user.id}/check',
params={'userId': member.id},
Expand Down
2 changes: 1 addition & 1 deletion minato_namikaze/bot_files/cogs/fun/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async def owoify(self, ctx, text):
async def magic(self, ctx, user: discord.Member = None):
'''See magic!'''
user = user or ctx.author
url = str(user.avatar_url_as(format="png", size=1024))
url = str(user.avatar.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.magik(), url)
e2file = discord.File(fp=img.image, filename=f"magik.{img.format}")
e = Embed(title="Magik!")
Expand Down
18 changes: 9 additions & 9 deletions minato_namikaze/bot_files/cogs/img/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def spank(self, ctx, member: discord.Member = ''):
join(self.DEFAULT_GIF_LIST_PATH, 'spank'))]

embed = discord.Embed(
description=desc, timestamp=datetime.datetime.utcnow())
description=desc, timestamp=discord.utils.utcnow())
image_name = random.choice(onlyfiles)

file = discord.File(join(self.DEFAULT_GIF_LIST_PATH,
Expand All @@ -70,7 +70,7 @@ async def slap(self, ctx, member: discord.Member = ''):
join(self.DEFAULT_GIF_LIST_PATH, 'slap'))]

embed = discord.Embed(
description=desc, timestamp=datetime.datetime.utcnow())
description=desc, timestamp=discord.utils.utcnow())
image_name = random.choice(onlyfiles)

file = discord.File(
Expand All @@ -79,8 +79,8 @@ async def slap(self, ctx, member: discord.Member = ''):
await ctx.send(file=file, embed=embed)
else:
user = member
url = str(user.avatar_url_as(format="png", size=1024))
img = await self.bot.dagpi.image_process(ImageFeatures.slap(), url2=str(ctx.author.avatar_url_as(format="png", size=1024)), url=url)
url = str(user.avatar.with_format("png").with_size(1024))
img = await self.bot.dagpi.image_process(ImageFeatures.slap(), url2=str(ctx.author.with_format("png").with_size(1024).url), url=url)
e2file = discord.File(fp=img.image, filename=f"slap.{img.format}")
e = discord.Embed(description=desc)
e.set_image(url=f"attachment://slap.{img.format}")
Expand All @@ -103,7 +103,7 @@ async def hug(self, ctx, member: discord.Member = ''):
join(self.DEFAULT_GIF_LIST_PATH, 'hug'))]

embed = discord.Embed(
description=desc, timestamp=datetime.datetime.utcnow())
description=desc, timestamp=discord.utils.utcnow())
image_name = random.choice(onlyfiles)

file = discord.File(join(self.DEFAULT_GIF_LIST_PATH,
Expand All @@ -128,7 +128,7 @@ async def poke(self, ctx, member: discord.Member = ''):
join(self.DEFAULT_GIF_LIST_PATH, 'poke'))]

embed = discord.Embed(
description=desc, timestamp=datetime.datetime.utcnow())
description=desc, timestamp=discord.utils.utcnow())
image_name = random.choice(onlyfiles)

file = discord.File(join(self.DEFAULT_GIF_LIST_PATH,
Expand All @@ -153,7 +153,7 @@ async def high5(self, ctx, member: discord.Member = ''):
join(self.DEFAULT_GIF_LIST_PATH, 'high5'))]

embed = discord.Embed(
description=desc, timestamp=datetime.datetime.utcnow())
description=desc, timestamp=discord.utils.utcnow())
image_name = random.choice(onlyfiles)

file = discord.File(join(self.DEFAULT_GIF_LIST_PATH,
Expand All @@ -177,7 +177,7 @@ async def party(self, ctx, member: discord.Member = ''):
join(self.DEFAULT_GIF_LIST_PATH, 'party'))]

embed = discord.Embed(
description=desc, timestamp=datetime.datetime.utcnow())
description=desc, timestamp=discord.utils.utcnow())
image_name = random.choice(onlyfiles)

file = discord.File(join(self.DEFAULT_GIF_LIST_PATH,
Expand All @@ -191,7 +191,7 @@ async def pat(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.petpet(), url)
e2file = discord.File(fp=img.image, filename=f"petpet.{img.format}")
e = discord.Embed(title="UwU Pat!")
Expand Down
36 changes: 18 additions & 18 deletions minato_namikaze/bot_files/cogs/img/img.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def wni(self, ctx, *, member: discord.Member = ''):
file = discord.File(file_path)

embed = discord.Embed(
description=desc, timestamp=datetime.datetime.utcnow())
description=desc, timestamp=discord.utils.utcnow())
embed.set_image(url=f"attachment://{file_path}")
await ctx.send(file=file, embed=embed)

Expand All @@ -62,7 +62,7 @@ async def wi(self, ctx, *, member: discord.Member = ''):
return

embed = discord.Embed(
description=desc, timestamp=datetime.datetime.utcnow())
description=desc, timestamp=discord.utils.utcnow())

img = Image.open(FileIO(self.DEFAULT_GIF_LIST_PATH /
os.path.join("amongus.png")))
Expand All @@ -82,7 +82,7 @@ async def triggered(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.triggered(), url)
e2file = discord.File(fp=img.image, filename=f"triggered.{img.format}")
e = discord.Embed(title="Here You Go! Filter used is triggered!")
Expand All @@ -97,7 +97,7 @@ async def message(self, ctx, member: discord.Member = None, *, text):

uname = member.display_name
text = str(text)
pfp = str(member.avatar_url_as(format="png", size=1024))
pfp = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.discord(),
url=pfp,
username=uname,
Expand All @@ -118,7 +118,7 @@ async def captcha(self, ctx, member: discord.Member = None, *, text='Detect Face
if textaslen > 13:
await ctx.send("Maybe text length something smaller then 13?")
else:
pfp = str(member.avatar_url_as(format="png", size=1024))
pfp = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.captcha(),
url=pfp,
text=text)
Expand All @@ -134,7 +134,7 @@ async def pixel(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.pixel(), url)
e2file = discord.File(fp=img.image, filename=f"pixel.{img.format}")
e = discord.Embed(title="Here You Go! Filter used is pixel!")
Expand All @@ -146,7 +146,7 @@ async def jail(self, ctx, member: discord.Member = None):
"""Jail yourself or someone"""
if member is None:
member = ctx.author
url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.jail(), url=url)
e2file = discord.File(fp=img.image, filename=f"jail.{img.format}")
e = discord.Embed(title="Here You Go! Filter used is jail!")
Expand All @@ -159,7 +159,7 @@ async def wanted(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.wanted(), url)
e2file = discord.File(fp=img.image, filename=f"wanted.{img.format}")
e = discord.Embed(title="Here You Go! Filter used is wanted!")
Expand All @@ -172,7 +172,7 @@ async def rainbow(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.gay(), url)
e2file = discord.File(fp=img.image, filename=f"rainbow.{img.format}")
e = discord.Embed(title="Here You Go! Filter used is gay!")
Expand All @@ -185,7 +185,7 @@ async def gay(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.gay(), url)
e2file = discord.File(fp=img.image, filename=f"gay.{img.format}")
e = discord.Embed(title="There you go gay!")
Expand All @@ -198,7 +198,7 @@ async def trash(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=512))
url = str(member.with_format("png").with_size(512).url)
img = await self.bot.dagpi.image_process(ImageFeatures.trash(), url)
e2file = discord.File(fp=img.image, filename=f"trash.{img.format}")
e = discord.Embed(title="There you go piece of Trash!")
Expand All @@ -211,7 +211,7 @@ async def delete(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.delete(), url)
e2file = discord.File(fp=img.image, filename=f"delete.{img.format}")
e = discord.Embed(title="There you go piece of trash removed!")
Expand All @@ -224,7 +224,7 @@ async def angel(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=512))
url = str(member.with_format("png").with_size(512).url)
img = await self.bot.dagpi.image_process(ImageFeatures.angel(), url)
e2file = discord.File(fp=img.image, filename=f"angel.{img.format}")
e = discord.Embed(title="Our dear Angel!")
Expand All @@ -237,7 +237,7 @@ async def satan(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=64))
url = str(member.with_format("png").with_size(64).url)
img = await self.bot.dagpi.image_process(ImageFeatures.satan(), url)
e2file = discord.File(fp=img.image, filename=f"satan.{img.format}")
e = discord.Embed(title="Satan!!!")
Expand All @@ -250,7 +250,7 @@ async def charcoal(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.charcoal(), url)
e2file = discord.File(fp=img.image, filename=f"charcoal.{img.format}")
e = discord.Embed(title="There you go your lovely charcoal paintaing")
Expand All @@ -263,7 +263,7 @@ async def hitler(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=64))
url = str(member.with_format("png").with_size(64).url)
img = await self.bot.dagpi.image_process(ImageFeatures.hitler(), url)
e2file = discord.File(fp=img.image, filename=f"hitler.{img.format}")
e = discord.Embed(title="Worse than Hitler!!!")
Expand All @@ -276,7 +276,7 @@ async def wasted(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.wasted(), url)
e2file = discord.File(fp=img.image, filename=f"wasted.{img.format}")
e = discord.Embed(title="Wasted! :skull_crossbones:")
Expand All @@ -290,7 +290,7 @@ async def bomb(self, ctx, member: discord.Member = None):
if member is None:
member = ctx.author

url = str(member.avatar_url_as(format="png", size=1024))
url = str(member.with_format("png").with_size(1024).url)
img = await self.bot.dagpi.image_process(ImageFeatures.bomb(), url)
e2file = discord.File(fp=img.image, filename=f"wasted.{img.format}")
e.set_image(url=f"attachment://bomb.{img.format}")
Expand Down
2 changes: 1 addition & 1 deletion minato_namikaze/bot_files/cogs/info/mysupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async def inviteme(self, ctx):
'''Generates my invite link for your server'''
embed = discord.Embed(
title='**Invite Link**', description=f'[My Invite Link!](https://discord.com/oauth2/authorize?client_id=779559821162315787&permissions=8&redirect_uri=https%3A%2F%2Fminatonamikaze-invites.herokuapp.com%2Finvite&scope=applications.commands%20bot&response_type=code&state=cube12345%3F%2FDirect%20From%20Bot)')
embed.set_thumbnail(url=ctx.bot.user.avatar_url)
embed.set_thumbnail(url=ctx.bot.user.avatar.url)
await ctx.send(embed=embed)

@commands.command(description='Generates my support server invite')
Expand Down
Loading