-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b142aaf
Showing
23 changed files
with
1,263 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
TOKEN=your discord bot TOKEN | ||
API_KEY=your api key for api.anondev.ml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
.env.production | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
prettier.config.js | ||
json.sqlite | ||
.breakpoints | ||
package-lock.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
run = "npm start" | ||
language = "nodejs" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
const { | ||
Command, | ||
MessageActionRow, | ||
MessageButton, | ||
ArgumentType, | ||
} = require("gcommands"); | ||
const Discord = require("discord.js"); | ||
|
||
module.exports = class extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "animal", | ||
description: "Get random animal", | ||
args: [ | ||
{ | ||
name: "animal", | ||
type: ArgumentType.STRING, | ||
description: "Animal to get image of", | ||
required: true, | ||
choices: [ | ||
{ name: "Cat", value: "cat" }, | ||
{ name: "Dog", value: "dog" }, | ||
{ name: "Fox", value: "fox" }, | ||
{ name: "Panda", value: "panda" }, | ||
{ name: "Red Panda", value: "red_panda" }, | ||
{ name: "Bird", value: "bird" }, | ||
{ name: "Koala", value: "koala" }, | ||
{ name: "Raccoon", value: "raccoon" }, | ||
{ name: "Kangaroo", value: "kangaroo" }, | ||
{ name: "Shiba", value: "shiba" }, | ||
], | ||
}, | ||
], | ||
}); | ||
} | ||
async run({ | ||
client, | ||
interaction, | ||
respond, | ||
guild, | ||
edit, | ||
member, | ||
author, | ||
args, | ||
objectArgs, | ||
message, | ||
}) { | ||
const resp = await client | ||
.request(`/api/images/${objectArgs.animal}`, "GET") | ||
.catch((err) => { | ||
console.log("Error while fetching API endpoint", err); | ||
return respond({ | ||
content: `:x: Error while fetching API endpoint \`${err.message}\``, | ||
ephemeral: true, | ||
}); | ||
}); | ||
let data = await resp.json(); | ||
if (!resp.ok) { | ||
console.log(`API returned error ${resp.status} ${resp.statusText}`, data); | ||
return respond({ | ||
content: `:x: API returned error \`${resp.status} ${ | ||
resp.statusText | ||
}\`\n\n> \`${JSON.stringify(data)}\``, | ||
ephemeral: true, | ||
}); | ||
} | ||
|
||
const embed = new Discord.MessageEmbed() | ||
.setTitle(`${client.helpers.capitalize(objectArgs.animal)}`) | ||
.setImage(data.url) | ||
.setColor("RANDOM") | ||
.setFooter(client.user.username, client.user.avatarURL()) | ||
.setTimestamp(); | ||
|
||
respond({ | ||
embeds: [embed], | ||
ephemeral: false, | ||
}); | ||
} | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
const { | ||
Command, | ||
MessageActionRow, | ||
MessageButton, | ||
ArgumentType, | ||
} = require("gcommands"); | ||
const Discord = require("discord.js"); | ||
|
||
module.exports = class extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "changemymind", | ||
description: "Generate change my mind meme", | ||
args: [ | ||
{ | ||
name: "text", | ||
type: ArgumentType.STRING, | ||
description: "Text", | ||
required: true, | ||
}, | ||
], | ||
}); | ||
} | ||
async run({ | ||
client, | ||
interaction, | ||
respond, | ||
guild, | ||
edit, | ||
member, | ||
author, | ||
args, | ||
objectArgs, | ||
message, | ||
}) { | ||
const resp = await client | ||
.request( | ||
`/api/images/changemymind?text=${encodeURIComponent(objectArgs.text)}`, | ||
"GET" | ||
) | ||
.catch((err) => { | ||
console.log("Error while fetching API endpoint", err); | ||
return respond({ | ||
content: `:x: Error while fetching API endpoint \`${err.message}\``, | ||
ephemeral: true, | ||
}); | ||
}); | ||
let data = await resp.json(); | ||
if (!resp.ok) { | ||
console.log(`API returned error ${resp.status} ${resp.statusText}`, data); | ||
return respond({ | ||
content: `:x: API returned error \`${resp.status} ${ | ||
resp.statusText | ||
}\`\n\n> \`${JSON.stringify(data)}\``, | ||
ephemeral: true, | ||
}); | ||
} | ||
|
||
const embed = new Discord.MessageEmbed() | ||
.setTitle(`Change My Mind`) | ||
.setImage(data.url) | ||
.setColor("RANDOM") | ||
.setFooter(client.user.username, client.user.avatarURL()) | ||
.setTimestamp(); | ||
|
||
respond({ | ||
embeds: [embed], | ||
ephemeral: false, | ||
}); | ||
} | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
const { | ||
Command, | ||
MessageActionRow, | ||
MessageButton, | ||
ArgumentType, | ||
} = require("gcommands"); | ||
const Discord = require("discord.js"); | ||
|
||
module.exports = class extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "clyde", | ||
description: "Generate Clyde Discord bot image", | ||
args: [ | ||
{ | ||
name: "text", | ||
type: ArgumentType.STRING, | ||
description: "Text", | ||
required: true, | ||
}, | ||
], | ||
}); | ||
} | ||
async run({ | ||
client, | ||
interaction, | ||
respond, | ||
guild, | ||
edit, | ||
member, | ||
author, | ||
args, | ||
objectArgs, | ||
message, | ||
}) { | ||
const resp = await client | ||
.request( | ||
`/api/images/clyde?text=${encodeURIComponent(objectArgs.text)}`, | ||
"GET" | ||
) | ||
.catch((err) => { | ||
console.log("Error while fetching API endpoint", err); | ||
return respond({ | ||
content: `:x: Error while fetching API endpoint \`${err.message}\``, | ||
ephemeral: true, | ||
}); | ||
}); | ||
let data = await resp.json(); | ||
if (!resp.ok) { | ||
console.log(`API returned error ${resp.status} ${resp.statusText}`, data); | ||
return respond({ | ||
content: `:x: API returned error \`${resp.status} ${ | ||
resp.statusText | ||
}\`\n\n> \`${JSON.stringify(data)}\``, | ||
ephemeral: true, | ||
}); | ||
} | ||
|
||
const embed = new Discord.MessageEmbed() | ||
.setTitle(`Clyde`) | ||
.setImage(data.url) | ||
.setColor("RANDOM") | ||
.setFooter(client.user.username, client.user.avatarURL()) | ||
.setTimestamp(); | ||
|
||
respond({ | ||
embeds: [embed], | ||
ephemeral: false, | ||
}); | ||
} | ||
}; |
Oops, something went wrong.