diff --git a/bot.py b/bot.py index 0076884..1414002 100644 --- a/bot.py +++ b/bot.py @@ -9,6 +9,7 @@ from os import environ from discord.ext import commands from discord.commands import Option from discord.commands import permissions +from discord.ui import InputText, Modal def left(s, amount): return s[:amount] @@ -152,11 +153,22 @@ async def gmroll(ctx, em = discord.Embed(title=rolle, description=rolltotal, colour=0x009933) await ctx.response.send_message(embed=em, ephemeral=True) +class MyModal(Modal): + def __init__(self) -> None: + super().__init__("Emojitext") + self.add_item(InputText(label="Dein Text:", placeholder="Jeder Buchstabe nur einmal!")) + + async def callback(self, interaction: discord.Interaction): + emojitext = self.children[0].value.lower.strip + for x in list(emojitext): + await interaction.message.add_reaction(alphabet[x]) + await interaction.response.send_message(content="done", ephemeral=True) + @bot.message_command(name="Emoji Text", guild_ids=[261575556708040705]) +@permissions.has_role(member_role) async def emoji_text(ctx, message: discord.Message): - emojitext = "shiba" - for x in list(emojitext): - await message.add_reaction(alphabet[x]) + modal = MyModal() + await ctx.interaction.response.send_modal(modal) @bot.command(help="veraltet", usage="", hidden=True) @is_member()