-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bf52a4
commit 3c8a6be
Showing
12 changed files
with
505 additions
and
35 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,33 @@ | ||
APScheduler==3.8.1 | ||
aiocache==0.11.1 | ||
aiohttp==3.8.1 | ||
aiosignal==1.2.0 | ||
APScheduler==3.9.1 | ||
async-timeout==4.0.2 | ||
attrs==21.4.0 | ||
autopep8==1.6.0 | ||
charset-normalizer==2.0.12 | ||
aiofiles==0.8.0 | ||
aiohttp==3.7.4.post0 | ||
async-timeout==3.0.1 | ||
attrs==21.2.0 | ||
chardet==4.0.0 | ||
e==1.4.5 | ||
expiringdict==1.2.1 | ||
fold-to-ascii==1.0.2.post1 | ||
git+https://github.com/Rapptz/discord.py@4dc24a0 | ||
fold_to_ascii==1.0.2.post1 | ||
frozenlist==1.3.0 | ||
humanfriendly==10.0 | ||
humanize==3.12.0 | ||
idna==3.3 | ||
mongoengine==0.24.0 | ||
multidict==6.0.2 | ||
psutil==5.9.0 | ||
pycodestyle==2.8.0 | ||
pymongo==4.0 | ||
python-dotenv==0.19.2 | ||
markovify==0.9.3 | ||
mongoengine==0.23.1 | ||
multidict==5.2.0 | ||
psutil==5.8.0 | ||
pymongo[srv]==3.12.1 | ||
pytimeparse==1.1.8 | ||
python-dotenv==0.19.1 | ||
pytz==2021.3 | ||
pytz-deprecation-shim==0.1.0.post0 | ||
radium==1.0.2 | ||
six==1.16.0 | ||
toml==0.10.2 | ||
typing-extensions==3.10.0.2 | ||
yarl==1.7.0 | ||
colorthief==0.2.1 | ||
tzdata==2021.5 | ||
tzlocal==4.1 | ||
yarl==1.7.2 | ||
bs4==0.0.1 | ||
ujson==4.2.0 | ||
msgpack==1.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
from .database import * | ||
from .logging import * | ||
from .cache import * | ||
# from .tasks import * | ||
from .jobs import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from .autocompleters import * | ||
from .confirm import * | ||
from .menu import * | ||
from .misc import * | ||
from .modals.commonissue import * | ||
from .modals.prompt import * | ||
from .modals.tag import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import discord | ||
|
||
from utils import BlooContext | ||
|
||
|
||
class PFPView(discord.ui.View): | ||
def __init__(self, ctx: BlooContext, embed=discord.Embed): | ||
super().__init__(timeout=3) | ||
self.embed = embed | ||
self.ctx = ctx | ||
|
||
async def on_timeout(self): | ||
for child in self.children: | ||
child.disabled = True | ||
await self.ctx.respond_or_edit(embed=self.embed, view=self) | ||
|
||
|
||
class PFPButton(discord.ui.Button): | ||
def __init__(self, ctx: BlooContext, member: discord.Member): | ||
super().__init__(label="Show other avatar", style=discord.ButtonStyle.primary) | ||
self.ctx = ctx | ||
self.member = member | ||
self.other = False | ||
|
||
async def callback(self, interaction: discord.Interaction): | ||
if interaction.user != self.ctx.author: | ||
return | ||
if not self.other: | ||
avatar = self.member.guild_avatar | ||
self.other = not self.other | ||
else: | ||
avatar = self.member.avatar or self.member.default_avatar | ||
self.other = not self.other | ||
|
||
embed = interaction.message.embeds[0] | ||
embed.set_image(url=avatar.replace(size=4096)) | ||
|
||
animated = ["gif", "png", "jpeg", "webp"] | ||
not_animated = ["png", "jpeg", "webp"] | ||
|
||
def fmt(format_): | ||
return f"[{format_}]({avatar.replace(format=format_, size=4096)})" | ||
|
||
if avatar.is_animated(): | ||
embed.description = f"View As\n {' '.join([fmt(format_) for format_ in animated])}" | ||
else: | ||
embed.description = f"View As\n {' '.join([fmt(format_) for format_ in not_animated])}" | ||
|
||
await interaction.response.edit_message(embed=embed) |