how to make a discord bot in python
import discord
from discord.ext import commands
client = commands.Bot(command_prefix=".")
@client.event
async def on_ready():
print("Ready!")
bot.run("TOKEN")
how to make a discord bot in python
import discord
from discord.ext import commands
client = commands.Bot(command_prefix=".")
@client.event
async def on_ready():
print("Ready!")
bot.run("TOKEN")
discord python application bot
q_list = [
'What is your favorite color?',
'Is the Sky Blue?',
'Am I the best bot ever?'
]
a_list = []
@client.command(aliases=['staff-application'])
async def staff_application(ctx):
a_list = []
submit_channel = client.get_channel(<your channel id>)
channel = await ctx.author.create_dm()
def check(m):
return m.content is not None and m.channel == channel
for question in q_list:
sleep(.5)
await channel.send(question)
msg = await client.wait_for('message', check=check)
a_list.append(msg.content)
submit_wait = True
while submit_wait:
await channel.send('End of questions - "submit" to finish')
msg = await client.wait_for('message', check=check)
if "submit" in msg.content.lower():
submit_wait = False
answers = "n".join(f'{a}. {b}' for a, b in enumerate(a_list, 1))
submit_msg = f'Application from {msg.author} nThe answers are:n{answers}'
await submit_channel.send(submit_msg)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us