Replies: 2 comments 1 reply
-
you're using text commands, (they are invoked through '[prefix]command <args...>'). To make slash commands, see: https://github.com/Rapptz/discord.py/blob/master/examples/app_commands/basic.py |
Beta Was this translation helpful? Give feedback.
-
This issue in unworkable to be honest. I can see you've provided code but you haven't really explained the issue? I can see you set the prefix to
Or are you doing something else? |
Beta Was this translation helpful? Give feedback.
-
import discord
from discord.ext import commands
intents = discord.Intents.all()
intents.members = True
intents.typing = True
intents.presences = True
intents.message_content = True
bot = commands.Bot(command_prefix='!', intents=intents)
events = {}
cooldown = commands.CooldownMapping.from_cooldown(1, 5, commands.BucketType.user)
@bot.event
async def on_ready():
print(f'{bot.user} has connected to Discord!')
@bot.command(name='create_event', help='Create a new event')
async def create_event(ctx, date, time, description):
# Add logic to store the event details (database, file, etc.)
response = f'Event created on {date} at {time}. Description: {description}'
await ctx.send(response)
@bot.command(name='list_events', help='List all upcoming events')
async def list_events(ctx):
# Add logic to retrieve and display upcoming events
events = ['Event 1', 'Event 2', 'Event 3']
response = '\n'.join(events) if events else 'No upcoming events.'
await ctx.send(response)
bot.run('token')
Beta Was this translation helpful? Give feedback.
All reactions