mirror of
https://github.com/Team-Neptune/Korral-Interactions.git
synced 2024-11-23 12:49:40 +00:00
Add banlist command
Shows a list of known items that can ban you on your Nintendo Switch™️
This commit is contained in:
parent
caa4556a77
commit
b98a3d6e31
37
src/commands/banlist.ts
Normal file
37
src/commands/banlist.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import Command from "../classes/Command";
|
||||
import { config } from "../../config";
|
||||
import fetch from "node-fetch";
|
||||
import { Message } from "../../typings";
|
||||
|
||||
const discord_api = "https://discord.com/api/v9"
|
||||
|
||||
const getMessage = (channel_id, message_id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
fetch(`${discord_api}/channels/${channel_id}/messages/${message_id}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
authorization: `Bot ${process.env.bot_token || config.bot_token}`,
|
||||
},
|
||||
})
|
||||
.then((r) => r.json())
|
||||
.then(resolve)
|
||||
.catch(reject)
|
||||
})
|
||||
}
|
||||
|
||||
const message_guild_id = "703301751171973190"
|
||||
const message_channel_id = "703302552594284594"
|
||||
const message_id = "824322420529823764"
|
||||
|
||||
export default new Command({
|
||||
execute(interaction){
|
||||
interaction.ack({ephemeral:false}).then(() => {
|
||||
getMessage(message_channel_id, message_id).then((m) => {
|
||||
interaction.reply({
|
||||
content:`${(m as Message).content}\n\n[Jump to Message](https://discord.com/channels/${message_guild_id}/${message_channel_id}/${message_id})`
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue
Block a user