Adding basic poll functionality

This commit is contained in:
2022-04-27 17:14:17 +02:00
parent 97ff22fa51
commit 13cc41dadd
2 changed files with 23 additions and 1 deletions

23
cambot/polls.py Normal file
View File

@@ -0,0 +1,23 @@
import nextcord
class Poll:
def __init__(self):
self.message = None
self.owner = None
self.intro = None
self.options = {}
class Button(nextcord.ui.Button):
def __init__(self, owner):
super().__init__(label=f"Supprimer le sondage ({owner.display_name} uniquement)",
emoji="\N{cross mark}")
self.owner = owner
async def callback(self, interaction):
if interaction.user == self.owner:
await interaction.message.delete()
class ButtonView(nextcord.ui.View):
def __init__(self, owner):
super().__init__()
self.add_item(Button(owner=owner))

1
run.py
View File

@@ -13,7 +13,6 @@ from cambot.settings import *
bot = nextcord.Client()
codenames_games = {}
wordle_games = {}
# Startup
@bot.event