summaryrefslogtreecommitdiff
path: root/deps/discord-haskell/examples
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-01-11 20:42:57 -0500
committerLLLL Colonq <llll@colonq>2024-01-11 20:42:57 -0500
commitae18b594c97782cc201ffa365f12064831b1ec93 (patch)
tree5570a7f8ab15a113f332839b900c2c47444e7314 /deps/discord-haskell/examples
parent0be357bb60a2bc4523056aba34add78b715211f5 (diff)
Handle stickers, properly handle exceptions in threads
Diffstat (limited to 'deps/discord-haskell/examples')
-rw-r--r--deps/discord-haskell/examples/interaction-commands.hs10
-rw-r--r--deps/discord-haskell/examples/ping-pong.hs6
2 files changed, 5 insertions, 11 deletions
diff --git a/deps/discord-haskell/examples/interaction-commands.hs b/deps/discord-haskell/examples/interaction-commands.hs
index 7d22825..50e0b1d 100644
--- a/deps/discord-haskell/examples/interaction-commands.hs
+++ b/deps/discord-haskell/examples/interaction-commands.hs
@@ -54,15 +54,11 @@ interactionCommandExample = do
-- Use place to execute commands you know you want to complete
startHandler :: GuildId -> DiscordHandler ()
startHandler testserverid = do
- let activity =
- def
- { activityName = "ping-pong",
- activityType = ActivityTypeGame
- }
+ let activity = mkActivity "interaction-commands" ActivityTypeGame
let opts =
UpdateStatusOpts
{ updateStatusOptsSince = Nothing,
- updateStatusOptsGame = Just activity,
+ updateStatusOptsActivities = [activity],
updateStatusOptsNewStatus = UpdateStatusOnline,
updateStatusOptsAFK = False
}
@@ -394,7 +390,7 @@ eventHandler testserverid event = case event of
void
( do
exampleImage <- liftIO getImage
- aid <- readCache <&> cacheApplication <&> partialApplicationID
+ aid <- readCache <&> cacheApplication <&> fullApplicationID
_ <- restCall (R.CreateInteractionResponse interactionId interactionToken InteractionResponseDeferChannelMessage)
restCall
( R.CreateFollowupInteractionMessage
diff --git a/deps/discord-haskell/examples/ping-pong.hs b/deps/discord-haskell/examples/ping-pong.hs
index 87ec08b..3dff866 100644
--- a/deps/discord-haskell/examples/ping-pong.hs
+++ b/deps/discord-haskell/examples/ping-pong.hs
@@ -42,11 +42,9 @@ startHandler :: GuildId -> DiscordHandler ()
startHandler testserverid = do
liftIO $ putStrLn "Started ping-pong bot"
- let activity = def { activityName = "ping-pong"
- , activityType = ActivityTypeGame
- }
+ let activity = (mkActivity "ping-pong" ActivityTypeStreaming) { activityUrl = Just "https://www.youtube.com/watch?v=dQw4w9WgXcQ", activityState = Just "rolling down a hill" }
let opts = UpdateStatusOpts { updateStatusOptsSince = Nothing
- , updateStatusOptsGame = Just activity
+ , updateStatusOptsActivities = [activity]
, updateStatusOptsNewStatus = UpdateStatusOnline
, updateStatusOptsAFK = False
}