Add a test command for adding mesage reactions.
This commit is contained in:
parent
7f7717ce63
commit
61cfff995a
|
@ -1,6 +1,6 @@
|
||||||
import websocket, asyncnet, asyncdispatch, json, httpClient, eventdispatcher, strformat
|
import websocket, asyncdispatch, json, httpClient, eventdispatcher, strformat
|
||||||
import eventhandler, streams, nimcordutils, discordobject, user, cache, clientobjects
|
import eventhandler, streams, nimcordutils, discordobject, user, cache, clientobjects
|
||||||
import strutils, channel, options
|
import strutils, channel, options, message, emoji
|
||||||
|
|
||||||
const
|
const
|
||||||
nimcordMajor = 0
|
nimcordMajor = 0
|
||||||
|
@ -154,7 +154,12 @@ registerEventListener(EventType.evtMessageCreate, proc(bEvt: BaseEvent) =
|
||||||
amount = parseIntEasy(event.message.content.substr(20))
|
amount = parseIntEasy(event.message.content.substr(20))
|
||||||
let messages = channel.getMessages(MessagesGetRequest(limit: some(amount), before: some(event.message.id)))
|
let messages = channel.getMessages(MessagesGetRequest(limit: some(amount), before: some(event.message.id)))
|
||||||
discard channel.bulkDeleteMessages(messages)
|
discard channel.bulkDeleteMessages(messages)
|
||||||
|
elif (event.message.content.startsWith("?reactToMessage")):
|
||||||
|
var channel: Channel = event.message.getMessageChannel(event.client.cache)
|
||||||
|
if (channel != nil):
|
||||||
|
let emojis = @[newEmoji("⏮️"), newEmoji("⬅️"), newEmoji("⏹️"), newEmoji("➡️"), newEmoji("⏭️")]
|
||||||
|
for emoji in emojis:
|
||||||
|
discard event.message.addReaction(emoji)
|
||||||
)
|
)
|
||||||
|
|
||||||
waitFor bot.startConnection()
|
waitFor bot.startConnection()
|
Reference in New Issue