# Adding Raid Command to Twitch bot (SOLVED)

**URL:** <https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220>\
**Category:** Chat and IRC\
**Created:** [May 1, 2022, 10:59pm UTC](https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220 "2022-05-01T22:59:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![FreakSheep](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/freaksheep/32/17992_2.png) [@FreakSheep](https://discuss.dev.twitch.com/u/FreakSheep)\
**Post date:** [May 1, 2022, 10:59pm UTC](https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220/1 "2022-05-01T22:59:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [May 1, 2022, 11:08pm UTC](https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220/2 "2022-05-01T23:08:24Z")

</div>

~~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](https://help.twitch.tv/s/article/chat-commands?language=en_US) on the editor level commands

See also [Cannot run "editor" level commands via chat. · Issue #446 · twitchdev/issues · GitHub](https://github.com/twitchdev/issues/issues/446) and [Twitch Chat Commands | Twitch Developers](https://dev.twitch.tv/docs/irc/chat-commands)

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

---

<div class="post-metadata">

**Author:** ![FreakSheep](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/freaksheep/32/17992_2.png) [@FreakSheep](https://discuss.dev.twitch.com/u/FreakSheep)\
**Post date:** [May 1, 2022, 11:14pm UTC](https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220/3 "2022-05-01T23:14:10Z")

</div>

he is a editor  
also i cant even do it myself

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [May 1, 2022, 11:14pm UTC](https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220/4 "2022-05-01T23:14:33Z")

</div>

> [@FreakSheep](#):
>
> also i cant even do it myself

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

---

<div class="post-metadata">

**Author:** ![FreakSheep](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/freaksheep/32/17992_2.png) [@FreakSheep](https://discuss.dev.twitch.com/u/FreakSheep)\
**Post date:** [May 1, 2022, 11:15pm UTC](https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220/5 "2022-05-01T23:15:28Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [May 1, 2022, 11:16pm UTC](https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220/6 "2022-05-01T23:16:18Z")

</div>

> [@FreakSheep](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![FreakSheep](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/freaksheep/32/17992_2.png) [@FreakSheep](https://discuss.dev.twitch.com/u/FreakSheep)\
**Post date:** [May 1, 2022, 11:18pm UTC](https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220/7 "2022-05-01T23:18:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [May 31, 2022, 11:18pm UTC](https://discuss.dev.twitch.com/t/adding-raid-command-to-twitch-bot-solved/38220/8 "2022-05-31T23:18:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
