diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/discord_image_bridge/discord.py | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/src/discord_image_bridge/discord.py b/src/discord_image_bridge/discord.py index 1257bc4..07920d7 100644 --- a/src/discord_image_bridge/discord.py +++ b/src/discord_image_bridge/discord.py @@ -280,37 +280,6 @@ class DiscordWsManager(cherrypy.process.plugins.SimplePlugin): def _response2return(repl): return (repl.status_code, repl.json() if repl.text else None) -def interaction_response_send_message(ctx, content, ephemeral=True, **kwargs): - params={ - "type":4, # CHANNEL_MESSAGE_WITH_SOURCE - "data":{ - "content":content, - } - } - params["data"].update(kwargs) - - if ephemeral: - params["data"]["flags"]=1<<6 # EPHEMERAL - - rq=Request("POST", - "/interactions/%s/%s/callback"%( - ctx["id"], - ctx["token"]), - json=params - ) - - repl=rl.sendrequest(rq, "interactions") - return _response2return(repl) - -def channel_thread_create(channel_id, name, **params): - params["name"]=name - - rq=Request("POST", - "/channels/%s/threads"%str(channel_id), - json=params - ) - repl=rl.sendrequest(rq, "channels/%s"%str(channel_id)) - return _response2return(repl) def channel_message_send(channel_id, content=None, **params): params["content"]=content @@ -321,4 +290,10 @@ def channel_message_send(channel_id, content=None, **params): repl=rl.sendrequest(rq, "channels/%s"%str(channel_id)) return _response2return(repl) +def channel_message_get(channel_id, message_id): + rq=Request("GET" + "/channels/%s/messages/%s"%(str(channel_id), str(message_id)) + ) + repl=rl.sendrequest(rq, "channels/%s"%str(channel_id)) + return _response2return(repl) |
