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
const { Canvas } = require("canvas-constructor"); // Import the Canvas thing from the 'canvas-constructor'. | |
const snekfetch = require("snekfetch") // Create a variable called 'snekfetch' that imports the snekfetch package aka the http request to get the image buffer. | |
function jesus(glob) { | |
// Get the jesus image | |
return snekfetch.get("https://cdn.discordapp.com/attachments/411126540131106816/465197193163440128/jesus.jpeg").then(res => { | |
const image = new Canvas(900, 756) | |
.addImage(res.body, 0, 0, 900, 756) // Adds the jesus image with x, y, width height | |
.addImage(glob, 420, 410, 500, 340) // adds the glob image with x, y, width height |
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
import dimscord, asyncdispatch, strutils, options, tables | |
let discord = newDiscordClient("") | |
proc getGuild(s: Shard, guild_id: string): Future[Guild] {.async.} = | |
if guild_id in s.cache.guilds: | |
return s.cache.guilds[guild_id] | |
result = await discord.api.getGuild(guild_id) | |
proc getGuildChannel(s: Shard, chan_id: string): Future[GuildChannel] {.async.} = |
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
proc interactionCreate(s: Shard, i: Interaction) {.event(discord).} = | |
await discord.api.createInteractionResponse(i.id, i.token, | |
InteractionResponse( | |
kind: irtDeferredChannelMessageWithSource | |
) | |
) | |
let data = get i.data | |
case data.name: | |
of "beep", "beepo": | |
var content = data.options["message"].str.get |
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
## voice in my test bot | |
## expect some random stuff with some lazy code, im not bothered about it as long as it works lol | |
## note: the code is filtered with only voice related stuff, although there are some parts that are irrelevent or useless | |
## just ignore them. | |
when defined(dimscordStable): | |
import dimscord | |
else: | |
import ../../dimscord/dimscord |