Discord.py @tasks.loop equivalent? #434
-
Greetings, I'm refactoring a Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
in python this is just coroutines scheduling if I'm correctly understanding you. Disgord allows you to register a channel for each event type, you can then have a goroutine dedicated for each to process events: https://pkg.go.dev/github.com/andersfylling/disgord#hdr-Listen_for_events_using_Channels outdated docs here (the client.On method no longer exists so you'd use client.Gateway().*Chan(...) instead): |
Beta Was this translation helpful? Give feedback.
in python this is just coroutines scheduling if I'm correctly understanding you. Disgord allows you to register a channel for each event type, you can then have a goroutine dedicated for each to process events: https://pkg.go.dev/github.com/andersfylling/disgord#hdr-Listen_for_events_using_Channels
outdated docs here (the client.On method no longer exists so you'd use client.Gateway().*Chan(...) instead):
https://github.com/andersfylling/disgord/blob/master/docs/examples/listen-for-messages.md