bot.py (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import discord
import bot_token
bot = discord.Bot()
@bot.slash_command()
async def hello(ctx, name: str = None):
name = name or ctx.author.name
await ctx.respond(f"Hello {name}!")
@bot.user_command(name="Say Hello")
async def hi(ctx, user):
await ctx.respond(f"{ctx.author.mention} says hello to {user.name}!")
bot.run(bot_token.token)
|