From 5d5ae94695a8b1db6da4e08ffed8e83db9ef4435 Mon Sep 17 00:00:00 2001 From: Zane <90309290+Zingzy@users.noreply.github.com> Date: Tue, 9 Apr 2024 15:00:12 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Bug=20Fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cogs/imagine_cog.py | 5 +++++ constants.py | 2 +- main.py | 36 +++++++++++++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/cogs/imagine_cog.py b/cogs/imagine_cog.py index cee1db5..351e3ef 100644 --- a/cogs/imagine_cog.py +++ b/cogs/imagine_cog.py @@ -232,6 +232,11 @@ async def imagine_command(self, interaction, prompt:str, model: app_commands.Cho await interaction.channel.send(embed=discord.Embed(title="Error", description="Width and Height must be greater than 16", color=discord.Color.red())) return + try: + model = model.value + except: + pass + start = datetime.datetime.now() try: diff --git a/constants.py b/constants.py index d1944ef..1d7716a 100644 --- a/constants.py +++ b/constants.py @@ -6,8 +6,8 @@ TOKEN = os.environ["TOKEN"] MONGODB_URI = os.environ["MONGODB_URI"] MODELS = [ - "swizz8", "dreamshaper", + "swizz8", "deliberate", "juggernaut", ] diff --git a/main.py b/main.py index aac6900..8733113 100644 --- a/main.py +++ b/main.py @@ -18,7 +18,7 @@ latencies = [] commands_ = { - " 🎨": """Generates AI Images based on your prompts + " 🎨": """Generates AI Images based on your prompts - **prompt** 🗣️ : Your prompt for the Image to be generated - **model** 🤖 : The model to be used for generating the Image - **width** ↔️ : The width of your prompted Image @@ -51,6 +51,7 @@ def __init__(self): intents = discord.Intents.default() intents.messages = True intents.message_content = True + intents.members = True super().__init__(command_prefix="!", intents=intents, help_command=None) self.synced = False @@ -108,6 +109,39 @@ async def on_message(message): await bot.process_commands(message) +@bot.event +async def on_member_join(member): + pollination_guild_id = 885844321461485618 + + if member.guild.id != pollination_guild_id: + return + + channel = member.guild.system_channel + if channel is not None: + embed = discord.Embed( + title=f"Welcome {member.name} to pollinations!", + description=f"Hello {member.mention}, welcome to pollinations!", + color=discord.Color.from_rgb(239, 98, 138), + ) + + try: + embed.set_thumbnail(url=member.avatar.url) + except: + embed.set_thumbnail(url=member.default_avatar.url) + + embed.add_field(name="", value="We are excited to see you!", inline=False) + embed.add_field(name="", value="When you are ready, check out the channels at the links below:", inline=False) + + view = discord.ui.View() + view.add_item(discord.ui.Button(label="💬 General Chat", url="https://discord.com/channels/885844321461485618/889573359111774329")) + view.add_item(discord.ui.Button(label="🤖 Pollinations.ai", url="https://discord.com/channels/885844321461485618/1123617013433110578")) + + try: + await channel.send(embed=embed, view=view) + except Exception as e: + print(e, file=sys.stdout) + + @bot.command() @commands.is_owner() async def sync(ctx):