Hacky but working way for emoji reactions and py-cord version bump
This commit is contained in:
parent
4b39c5f11f
commit
fc05d2bd72
2 changed files with 6 additions and 3 deletions
7
bot.py
7
bot.py
|
@ -165,15 +165,18 @@ class MyModal(Modal):
|
||||||
self.add_item(InputText(label="Dein Text:", placeholder="Jeder Buchstabe nur einmal!"))
|
self.add_item(InputText(label="Dein Text:", placeholder="Jeder Buchstabe nur einmal!"))
|
||||||
|
|
||||||
async def callback(self, interaction: discord.Interaction):
|
async def callback(self, interaction: discord.Interaction):
|
||||||
emojitext = self.children[0].value.lower.strip
|
emojitext = self.children[0].value.lower()
|
||||||
|
await interaction.response.defer()
|
||||||
|
original_message = await interaction.channel.fetch_message(int(self.title))
|
||||||
for x in list(emojitext):
|
for x in list(emojitext):
|
||||||
await interaction.message.add_reaction(alphabet[x])
|
await original_message.add_reaction(alphabet[x])
|
||||||
await interaction.response.send_message(content="done", ephemeral=True)
|
await interaction.response.send_message(content="done", ephemeral=True)
|
||||||
|
|
||||||
@bot.message_command(name="Emoji Text", guild_ids=[261575556708040705])
|
@bot.message_command(name="Emoji Text", guild_ids=[261575556708040705])
|
||||||
@permissions.has_role(member_role)
|
@permissions.has_role(member_role)
|
||||||
async def emoji_text(ctx, message: discord.Message):
|
async def emoji_text(ctx, message: discord.Message):
|
||||||
modal = MyModal()
|
modal = MyModal()
|
||||||
|
modal.title = f"{message.id}"
|
||||||
await ctx.interaction.response.send_modal(modal)
|
await ctx.interaction.response.send_modal(modal)
|
||||||
|
|
||||||
@bot.command(help="veraltet", usage="", hidden=True)
|
@bot.command(help="veraltet", usage="", hidden=True)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
py-cord==2.0.0b3
|
py-cord==2.0.0b4
|
Loading…
Add table
Add a link
Reference in a new issue