Skip to content
This repository was archived by the owner on Jul 19, 2021. It is now read-only.

Commit 2e08956

Browse files
committed
fix: make guildOnly restriction only apply to dm
* closes #453
1 parent 7efdc84 commit 2e08956

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

code-samples/command-handling/adding-features/11/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ client.on('message', message => {
2929

3030
if (!command) return;
3131

32-
if (command.guildOnly && message.channel.type !== 'text') {
32+
if (command.guildOnly && message.channel.type === 'dm') {
3333
return message.reply('I can\'t execute that command inside DMs!');
3434
}
3535

code-samples/command-handling/adding-features/12/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ client.on('message', message => {
2929

3030
if (!command) return;
3131

32-
if (command.guildOnly && message.channel.type !== 'text') {
32+
if (command.guildOnly && message.channel.type === 'dm') {
3333
return message.reply('I can\'t execute that command inside DMs!');
3434
}
3535

guide/command-handling/adding-features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ module.exports = {
130130
And in your main file, above the args checking line, add this in:
131131

132132
```js
133-
if (command.guildOnly && message.channel.type !== 'text') {
133+
if (command.guildOnly && message.channel.type === 'dm') {
134134
return message.reply('I can\'t execute that command inside DMs!');
135135
}
136136
```

guide/popular-topics/miscellaneous-examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const client = new Discord.Client();
4646

4747
client.on('message', message => {
4848
if (message.content === '!play') {
49-
if (message.channel.type !== 'text') return;
49+
if (message.channel.type === 'dm') return;
5050

5151
const { voiceChannel } = message.member;
5252

@@ -77,7 +77,7 @@ const client = new Discord.Client();
7777

7878
client.on('message', message => {
7979
if (message.content === '!play') {
80-
if (message.channel.type !== 'text') return;
80+
if (message.channel.type === 'dm') return;
8181

8282
const voiceChannel = message.member.voice.channel;
8383

0 commit comments

Comments
 (0)