Replies: 1 comment
-
Heya! Although you've got the correct idea, it's not quite there yet. When working with events, such as Let's take a look at the Bot Example using the commands ext: import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='>')
@bot.command()
async def ping(ctx):
await ctx.send('pong')
bot.run('token') Here, we can see that we use simple decorators in our code to perform certain actions. In this case, import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='>')
@bot.event
async def on_member_update(before, after):
# do our code
bot.run('token') So with this idea in mind, we can use it to store member data based on game activity, status, nickname, etc. Hope this helps clear things up, cheers! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey ! I just started a discord bot today, the main purpose of this is to track the time we spent on each game and cumulating it.
Since i'm a pretty big noob with this API and python in general.
I would like to know if there is a way to fetch when a user start and stop any game.
I look at the doc and find something with
discord.on_member_update(before, after)
but i'm not quite sure how it works.Thanks to everyone for this API !
Beta Was this translation helpful? Give feedback.
All reactions