Skip to content

Commit

Permalink
✨ Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zingzy committed Apr 9, 2024
1 parent e807141 commit 5d5ae94
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cogs/imagine_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
TOKEN = os.environ["TOKEN"]
MONGODB_URI = os.environ["MONGODB_URI"]
MODELS = [
"swizz8",
"dreamshaper",
"swizz8",
"deliberate",
"juggernaut",
]
Expand Down
36 changes: 35 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
latencies = []

commands_ = {
"</pollinate:1123582901544558612> 🎨": """Generates AI Images based on your prompts
"</pollinate:1223762317359976519> 🎨": """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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 5d5ae94

Please sign in to comment.