Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add temporary hack to support slash commands
Added support for new slash commands in a very dirty manner. Waiting for bwmarrin/discordgo#856 to be merged so they'll be supported in the official library.
- Loading branch information
Théo Vidal
committed
Jan 6, 2021
1 parent
5f45464
commit 6b2b083
Showing
2 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package irregular_verbs | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bwmarrin/discordgo" | ||
"github.com/theovidal/onyxcord" | ||
) | ||
|
||
func HandleInteraction(bot *onyxcord.Bot, message *discordgo.Message) { | ||
verbsPlayer := bot.Cache.Exists(context.Background(), "verbs:"+message.ChannelID).Val() | ||
if verbsPlayer == 1 { | ||
HandleAnswer(bot, message, "verbs:"+message.ChannelID) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters