Compare commits
No commits in common. "7631fcf1fd2fb67b581e6e74f53b73cbfcc1a1ad" and "0eff35508f09fc3be612cb178d996002ec88b443" have entirely different histories.
7631fcf1fd
...
0eff35508f
10
bot.py
10
bot.py
|
@ -7,7 +7,6 @@ import json
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from discord.ui import Modal, InputText
|
from discord.ui import Modal, InputText
|
||||||
from discord.utils import get
|
from discord.utils import get
|
||||||
from discord.ext import commands
|
|
||||||
from dbutil import MessageDB
|
from dbutil import MessageDB
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
@ -152,7 +151,7 @@ class ApplicationModal(discord.ui.Modal):
|
||||||
view.disable_all_items()
|
view.disable_all_items()
|
||||||
await interaction.followup.edit_message(message_id = interaction.message.id, view = view)
|
await interaction.followup.edit_message(message_id = interaction.message.id, view = view)
|
||||||
|
|
||||||
@commands.has_permissions(administrator=True)
|
|
||||||
@bot.slash_command(description = "Command used to set up the application prompt")
|
@bot.slash_command(description = "Command used to set up the application prompt")
|
||||||
async def setup(ctx):
|
async def setup(ctx):
|
||||||
embed = discord.Embed(title="**Start your application!**")
|
embed = discord.Embed(title="**Start your application!**")
|
||||||
|
@ -161,13 +160,6 @@ async def setup(ctx):
|
||||||
await ctx.response.send_message("Message set up", ephemeral=True)
|
await ctx.response.send_message("Message set up", ephemeral=True)
|
||||||
await ctx.channel.send(embeds=[embed], view=appStartView)
|
await ctx.channel.send(embeds=[embed], view=appStartView)
|
||||||
|
|
||||||
@setup.error
|
|
||||||
async def on_application_command_error(ctx, error):
|
|
||||||
if isinstance(error, commands.MissingPermissions):
|
|
||||||
await ctx.respond("You need Administrator permissions to use this command", ephemeral=True)
|
|
||||||
else:
|
|
||||||
raise error
|
|
||||||
|
|
||||||
class ApplicationStartButtonView(discord.ui.View):
|
class ApplicationStartButtonView(discord.ui.View):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(timeout=None)
|
super().__init__(timeout=None)
|
||||||
|
|
|
@ -113,7 +113,7 @@ class GuildAppDB():
|
||||||
applications = pickle.loads(application_blob)
|
applications = pickle.loads(application_blob)
|
||||||
if application_name in applications.keys():
|
if application_name in applications.keys():
|
||||||
questions = applications[application_name]["questions"]
|
questions = applications[application_name]["questions"]
|
||||||
return questions, len(questions)
|
return questions
|
||||||
else:
|
else:
|
||||||
return "error on get questions: application not found"
|
return "error on get questions: application not found"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue