Adding Raid Command to Twitch bot (SOLVED)

Hello
got a question

im trying to add a raid command to my bot so you can faster raid people

Exmple:
infinity_lotus91 Raid Command:
!ril

i tryed it in two way but every time i try it i get this

[00:49] info: [#freaksheep] Executing command: /raid infinity_lotus91
[00:49] info: [#freaksheep] You don’t have permission to perform that action.

these are the ways i tryed it With and without a @:

Option #1

client.on(‘chat’, (channel, user, message, self) => {
if (message === ‘!ril’) {
client.say(process.env.CHANNEL_TOKEN, ‘/raid infinity_lotus91’)
}
});

Option #2

client.on(‘chat’, (channel, user, message, self) => {
if (message.startsWith("!ril") && user.mod === true){
client.say(process.env.CHANNEL_TOKEN, “/raid infinity_lotus91”);
}
});

Thank you in advance

Raid is a moderation command so you need the moderation scope on the token used to connected to chat

Additionally the user issuing the raid (in this case your bot) needs to be an editor of the channel.

See also Customer Support on the editor level commands

See also Cannot run "editor" level commands via chat. · Issue #446 · twitchdev/issues · GitHub and Twitch Chat Commands | Twitch Developers

You need the channel_editor scope and the user needs to be an editor for the channel you wish to raid from.

he is a editor
also i cant even do it myself

You can’t do a raid yourself in regular chat?

ow you mean my bot needs to be a editor

so if my bot is not a editor i cant ise the command but it wil not work because the bot is not a editor ?

the user that triggers the raid in chat that actually types/sends /raid user in chat will need to be an editor.

Since you are trying to make your bot account do this, then the bot account needs to be an editor of the channel.

thanks i added Editor to my bot account and now it worked