Skip to content

Commit

Permalink
Adding support for multiple urls for RIP command
Browse files Browse the repository at this point in the history
  • Loading branch information
DMcP89 committed Apr 10, 2024
1 parent 7adf625 commit c5103e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions harambot/cogs/misc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import discord
import logging
import random

from discord.ext import commands
from discord import app_commands
Expand All @@ -24,5 +25,8 @@ async def rip(
guild = Guild.get(Guild.guild_id == str(interaction.guild_id))
message = guild.RIP_text + " " + (deceased if deceased else "Harambe")
embed = discord.Embed(title="", description="", color=0xEEE657)
if "," in guild.RIP_image_url:
images = guild.RIP_image_url.split(",")
guild.RIP_image_url = random.choice(images)
embed.set_image(url=guild.RIP_image_url)
await interaction.response.send_message(content=message, embed=embed)
2 changes: 1 addition & 1 deletion harambot/ui/modals.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ConfigModal(discord.ui.Modal, title="Configure Guild"):
)
RIP_image_url = discord.ui.TextInput(
label="RIP Image",
placeholder="Enter image url to use with $RIP command",
placeholder="Enter comma separated list of urls for $RIP command",
)

guild = None
Expand Down

0 comments on commit c5103e7

Please sign in to comment.