Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Preventing Commands in DMs - Sapphire - Imagine a Framework
S-IaF
Sapphire - Imagine a Framework
•
3y ago
•
25 replies
FrozenHyper
Preventing Commands in DMs
How do you prevent commands from being used in DMs
? Message commands
.
Solution
Add
runIn: 'GUILD_ANY'
runIn: 'GUILD_ANY'
to your command options
. This will only the command to be run in guild channels
. If you want to specify a type of channel there are opttions for that
Jump to solution
Sapphire - Imagine a Framework
Join
Sapphire is a next-gen object-oriented Discord.js bot framework.
2,261
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Prevent commands from being ran on DMs and prevent bots from using commands by default
S-IaF
Sapphire - Imagine a Framework / sapphire-support
2y ago
messageCreate not working with DMs
S-IaF
Sapphire - Imagine a Framework / sapphire-support
3y ago
Dms not being read by Event.messageCreate in listener.
S-IaF
Sapphire - Imagine a Framework / sapphire-support
3y ago
Two Commands In One File
S-IaF
Sapphire - Imagine a Framework / sapphire-support
2y ago