Support 50 Recruits
This commit is contained in:
9
main.py
9
main.py
@@ -63,7 +63,7 @@ settings = bot.create_group("set", "Einstellungen")
|
|||||||
def get_count_recruits(real = 0):
|
def get_count_recruits(real = 0):
|
||||||
cur.execute("SELECT count(*) FROM recruits WHERE recruit=1")
|
cur.execute("SELECT count(*) FROM recruits WHERE recruit=1")
|
||||||
count = cur.fetchone()[0]
|
count = cur.fetchone()[0]
|
||||||
if real is 0:
|
if real == 0:
|
||||||
if count > 25:
|
if count > 25:
|
||||||
count = count / 2
|
count = count / 2
|
||||||
return int(count)
|
return int(count)
|
||||||
@@ -182,6 +182,8 @@ class Yes_select_50(discord.ui.View):
|
|||||||
max_values=get_count_recruits(),
|
max_values=get_count_recruits(),
|
||||||
options=build_option_list(1)
|
options=build_option_list(1)
|
||||||
)
|
)
|
||||||
|
async def select_callback(self, select, interaction): # the function called when the user is done selecting options
|
||||||
|
await process_yes_vote(select, interaction)
|
||||||
|
|
||||||
@discord.ui.select(
|
@discord.ui.select(
|
||||||
custom_id="yes50_2",
|
custom_id="yes50_2",
|
||||||
@@ -190,7 +192,6 @@ class Yes_select_50(discord.ui.View):
|
|||||||
max_values=get_count_recruits(),
|
max_values=get_count_recruits(),
|
||||||
options=build_option_list(2)
|
options=build_option_list(2)
|
||||||
)
|
)
|
||||||
|
|
||||||
async def select_callback(self, select, interaction): # the function called when the user is done selecting options
|
async def select_callback(self, select, interaction): # the function called when the user is done selecting options
|
||||||
await process_yes_vote(select, interaction)
|
await process_yes_vote(select, interaction)
|
||||||
|
|
||||||
@@ -361,6 +362,8 @@ class No_select50(discord.ui.View):
|
|||||||
max_values=1,
|
max_values=1,
|
||||||
options=build_option_list()
|
options=build_option_list()
|
||||||
)
|
)
|
||||||
|
async def select_callback(self, select, interaction): # the function called when the user is done selecting options
|
||||||
|
await process_no_vote(interaction, select)
|
||||||
@discord.ui.select(
|
@discord.ui.select(
|
||||||
custom_id="no50_2",
|
custom_id="no50_2",
|
||||||
placeholder="Rekruten wählen...",
|
placeholder="Rekruten wählen...",
|
||||||
@@ -368,11 +371,11 @@ class No_select50(discord.ui.View):
|
|||||||
max_values=1,
|
max_values=1,
|
||||||
options=build_option_list(2)
|
options=build_option_list(2)
|
||||||
)
|
)
|
||||||
|
|
||||||
async def select_callback(self, select, interaction): # the function called when the user is done selecting options
|
async def select_callback(self, select, interaction): # the function called when the user is done selecting options
|
||||||
await process_no_vote(interaction, select)
|
await process_no_vote(interaction, select)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def create_no_embed():
|
def create_no_embed():
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Rekrutenbesichtigung: Nein-Stimme",
|
title="Rekrutenbesichtigung: Nein-Stimme",
|
||||||
|
|||||||
Reference in New Issue
Block a user