#Slash Commands and Client

1 messages · Page 1 of 1 (latest)

stuck night
#

I'm working on a reaction bot and i'm using disnake.Client to create my listener as I'd like to check all react events, not just ones for messages after bot start. I have a functioning listener for the on_raw_reaction_add event, but now i'm trying to add slash commands so the archived messages can be edited after the fact by a moderator.

When poking through the disnake docs I discovered the InteractionBot class, which looks like the proper interface to create commands with, however i've found no way to get both the Client and the Bot to run at the same time. What's the best solution for this? Should I create seperate python files and have two instances running or is there an easier method?

Here's a link to the current state of my project: https://github.com/washingdone/starboat

GitHub

A Custom Starboard Bot. Contribute to washingdone/starboat development by creating an account on GitHub.

native bridge
#

You don't ever need both. InteractionBot handles slash commands AND has all of the other features and functions of the disnake.Client class.

#

Also a quick note, you should not be doing any API calls or trying to get any data from the bot's cache in the on_ready method.

queen schooner
#

meh that on_ready fetch isnt a big deal

#

but yea it will occur multiple times for no reason

stuck night
#

Excellent! Ty both for you help!

#

hrm

#

it's not letting me add the solved tag but consider it so :p

queen schooner
#

Should be able /solved