summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author8cy <[email protected]>2020-05-05 17:49:49 -0700
committer8cy <[email protected]>2020-05-05 17:49:49 -0700
commit76de31680712004ca83880c8ef6d8ffa6b291f7e (patch)
tree35e6d3c94ac72fe267d69d5b3758266c02f5acc7 /src
parentmake default status cmd response uwufier's status (diff)
downloaddep-core-76de31680712004ca83880c8ef6d8ffa6b291f7e.tar.xz
dep-core-76de31680712004ca83880c8ef6d8ffa6b291f7e.zip
add api cmd, formatting, add cors to server
Diffstat (limited to 'src')
-rw-r--r--src/commands/bot/api.ts26
-rw-r--r--src/commands/bot/clientid.ts2
-rw-r--r--src/commands/bot/email.ts2
-rw-r--r--src/commands/bot/github.ts2
-rw-r--r--src/commands/bot/invite.ts2
-rw-r--r--src/commands/bot/ip.ts2
-rw-r--r--src/commands/bot/memorystats.ts2
-rw-r--r--src/commands/bot/memoryusage.ts2
-rw-r--r--src/commands/bot/npm.ts2
-rw-r--r--src/commands/bot/status.ts2
-rw-r--r--src/commands/bot/support.ts2
-rw-r--r--src/commands/bot/twitch.ts2
-rw-r--r--src/commands/bot/twitter.ts2
-rw-r--r--src/commands/bot/uptime.ts2
-rw-r--r--src/commands/bot/version.ts2
-rw-r--r--src/commands/bot/vote.ts2
-rw-r--r--src/commands/bot/website.ts2
-rw-r--r--src/commands/bot/youtube.ts2
-rw-r--r--src/server.ts7
19 files changed, 50 insertions, 17 deletions
diff --git a/src/commands/bot/api.ts b/src/commands/bot/api.ts
new file mode 100644
index 0000000..ff89fd8
--- /dev/null
+++ b/src/commands/bot/api.ts
@@ -0,0 +1,26 @@
+import { Command, CommandoMessage } from 'discord.js-commando';
+import emoji from 'emoji-random';
+import { MessageEmbed } from 'discord.js';
+
+module.exports = class APIBot extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'api',
+ group: 'bot',
+ memberName: 'api',
+ description: 'Gives you uwufier\'s API link and documentation.',
+ examples: ['uwu!api'],
+ userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ throttling: {
+ usages: 5,
+ duration: 30
+ },
+ });
+ }
+ run(msg: CommandoMessage) {
+ let emb = new MessageEmbed()
+ .setDescription('Here\'s a link to my [API](https://kyzer.co/discord/bots/uwufier/api/v1/). (To use, copy the given URL, then append the API endpoints looking to get to it.) As for documentation, it is currently under heavy re-writing. As soon as the documentation goes live, you can read through it on the [official uwufier website](https://kyzer.co/discord/bots/uwufier/)!' + emoji.random())
+ msg.say(emb)
+ }
+}; \ No newline at end of file
diff --git a/src/commands/bot/clientid.ts b/src/commands/bot/clientid.ts
index 9e7565c..1b084e4 100644
--- a/src/commands/bot/clientid.ts
+++ b/src/commands/bot/clientid.ts
@@ -9,7 +9,7 @@ module.exports = class ClientIDBot extends Command {
aliases: ['cid'],
group: 'bot',
memberName: 'clientid',
- description: 'Tells you the bot\'s client ID.',
+ description: 'Tells you uwufier\'s client ID.',
examples: ['uwu!clientid', 'uwu!cid'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/email.ts b/src/commands/bot/email.ts
index d884b99..f326c22 100644
--- a/src/commands/bot/email.ts
+++ b/src/commands/bot/email.ts
@@ -9,7 +9,7 @@ module.exports = class TwitchBot extends Command {
aliases: ['mail', 'contact', 'gmail'],
group: 'bot',
memberName: 'email',
- description: 'Gives you a reference to the bot author\'s (Sin) best method of contact.',
+ description: 'Gives you a reference to uwufier\'s authors\' (Sin) best method of contact.',
examples: ['uwu!email'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/github.ts b/src/commands/bot/github.ts
index 426d7ec..9a9b08d 100644
--- a/src/commands/bot/github.ts
+++ b/src/commands/bot/github.ts
@@ -9,7 +9,7 @@ module.exports = class GitHubBot extends Command {
aliases: ['git', 'gitlab'],
group: 'bot',
memberName: 'github',
- description: 'Gives you a link to the bot author\'s (Sin) GitHub profile.',
+ description: 'Gives you a link to uwufier\'s authors\' (Sin) GitHub profile.',
examples: ['uwu!github'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/invite.ts b/src/commands/bot/invite.ts
index 479e1a8..be74630 100644
--- a/src/commands/bot/invite.ts
+++ b/src/commands/bot/invite.ts
@@ -9,7 +9,7 @@ module.exports = class InviteBot extends Command {
aliases: ['inv'],
group: 'bot',
memberName: 'invite',
- description: 'Gives you the bot\'s invite link.',
+ description: 'Gives you uwufier\'s invite link.',
examples: ['uwu!invite', 'uwu!inv'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/ip.ts b/src/commands/bot/ip.ts
index c9c8ec0..c565cec 100644
--- a/src/commands/bot/ip.ts
+++ b/src/commands/bot/ip.ts
@@ -9,7 +9,7 @@ module.exports = class IPBot extends Command {
name: 'ip',
group: 'bot',
memberName: 'ip',
- description: 'Gives you the bot\'s ip.',
+ description: 'Gives you uwufier\'s ip.',
examples: ['uwu!ip'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/memorystats.ts b/src/commands/bot/memorystats.ts
index fd8be76..cc2a424 100644
--- a/src/commands/bot/memorystats.ts
+++ b/src/commands/bot/memorystats.ts
@@ -16,7 +16,7 @@ module.exports = class MemoryStatsBot extends Command {
],
group: 'bot',
memberName: 'memorystats',
- description: 'Checks the full, current, approximate memory usage statistics of the bot\'s Node.js process.',
+ description: 'Checks the full, current, approximate memory usage statistics of uwufier\'s Node.js process.',
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
throttling: {
diff --git a/src/commands/bot/memoryusage.ts b/src/commands/bot/memoryusage.ts
index c204454..c8fd2cc 100644
--- a/src/commands/bot/memoryusage.ts
+++ b/src/commands/bot/memoryusage.ts
@@ -15,7 +15,7 @@ module.exports = class MemoryUsageBot extends Command {
],
group: 'bot',
memberName: 'memoryusage',
- description: 'Checks the current, approximate memory usage of the bot\'s Node.js process.',
+ description: 'Checks the current, approximate memory usage of uwufier\'s Node.js process.',
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
throttling: {
diff --git a/src/commands/bot/npm.ts b/src/commands/bot/npm.ts
index fcb84a5..06b9f43 100644
--- a/src/commands/bot/npm.ts
+++ b/src/commands/bot/npm.ts
@@ -8,7 +8,7 @@ module.exports = class NPMBot extends Command {
name: 'npm',
group: 'bot',
memberName: 'npm',
- description: 'Gives you a link to the bot author\'s (Sin) NPM profile.',
+ description: 'Gives you a link to uwufier\'s authors\' (Sin) NPM profile.',
examples: ['uwu!npm'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/status.ts b/src/commands/bot/status.ts
index 7fe5bd0..3f53221 100644
--- a/src/commands/bot/status.ts
+++ b/src/commands/bot/status.ts
@@ -9,7 +9,7 @@ module.exports = class StatusBot extends Command {
aliases: ['botstatus', 'bot-status'],
group: 'bot',
memberName: 'status',
- description: 'Allows you to change the bots status',
+ description: 'Allows you to change uwufier\'s status.',
args: [
{
key: 'uType',
diff --git a/src/commands/bot/support.ts b/src/commands/bot/support.ts
index f6818ef..4bb292b 100644
--- a/src/commands/bot/support.ts
+++ b/src/commands/bot/support.ts
@@ -8,7 +8,7 @@ module.exports = class SupportBot extends Command {
name: 'support',
group: 'bot',
memberName: 'support',
- description: 'Gives you the bot\'s support server link.',
+ description: 'Gives you uwufier\'s support server link.',
examples: ['uwu!support'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/twitch.ts b/src/commands/bot/twitch.ts
index e8f8c1e..eb935c1 100644
--- a/src/commands/bot/twitch.ts
+++ b/src/commands/bot/twitch.ts
@@ -9,7 +9,7 @@ module.exports = class TwitchBot extends Command {
aliases: ['stream', 'streaming'],
group: 'bot',
memberName: 'twitch',
- description: 'Gives you a link to the bot author\'s (Sin) Twitch profile.',
+ description: 'Gives you a link to uwufier\'s authors\' (Sin) Twitch profile.',
examples: ['uwu!twitch'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/twitter.ts b/src/commands/bot/twitter.ts
index 5817000..04a8e56 100644
--- a/src/commands/bot/twitter.ts
+++ b/src/commands/bot/twitter.ts
@@ -8,7 +8,7 @@ module.exports = class TwitterBot extends Command {
name: 'twitter',
group: 'bot',
memberName: 'twitter',
- description: 'Gives you a link to the bot author\'s (Sin) Twitter profile.',
+ description: 'Gives you a link to uwufier\'s authors\' (Sin) Twitter profile.',
examples: ['uwu!twitter'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/uptime.ts b/src/commands/bot/uptime.ts
index 9128ab7..768d43a 100644
--- a/src/commands/bot/uptime.ts
+++ b/src/commands/bot/uptime.ts
@@ -11,7 +11,7 @@ export default class UptimeBot extends Command {
aliases: ['ut'],
group: 'bot',
memberName: 'uptime',
- description: 'Tells you how long the bot has been online.',
+ description: 'Tells you how long uwufier has been online.',
throttling: {
usages: 5,
duration: 30
diff --git a/src/commands/bot/version.ts b/src/commands/bot/version.ts
index 01119dc..564fd2f 100644
--- a/src/commands/bot/version.ts
+++ b/src/commands/bot/version.ts
@@ -9,7 +9,7 @@ export default class VersionBot extends Command {
name: 'version',
group: 'bot',
memberName: 'version',
- description: 'Tells you the bot\'s current build version.',
+ description: 'Tells you uwufier\'s current build version.',
throttling: {
usages: 5,
duration: 30
diff --git a/src/commands/bot/vote.ts b/src/commands/bot/vote.ts
index 8f64686..61ac999 100644
--- a/src/commands/bot/vote.ts
+++ b/src/commands/bot/vote.ts
@@ -7,7 +7,7 @@ module.exports = class VoteBot extends Command {
name: 'vote',
group: 'bot',
memberName: 'vote',
- description: 'Gives you the bot\'s top.gg vote link.',
+ description: 'Gives you uwufier\'s top.gg vote link.',
examples: ['uwu!vote'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/website.ts b/src/commands/bot/website.ts
index 209af4d..c556e53 100644
--- a/src/commands/bot/website.ts
+++ b/src/commands/bot/website.ts
@@ -9,7 +9,7 @@ module.exports = class WebsiteBot extends Command {
aliases: ['site', 'cyne.cf', 'cyne'],
group: 'bot',
memberName: 'website',
- description: 'Gives you a link to the bot author\'s (Sin) website.',
+ description: 'Gives you a link to uwufier\'s authors\' (Sin) website.',
examples: ['uwu!website'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/commands/bot/youtube.ts b/src/commands/bot/youtube.ts
index 901dd74..b158db0 100644
--- a/src/commands/bot/youtube.ts
+++ b/src/commands/bot/youtube.ts
@@ -9,7 +9,7 @@ module.exports = class YouTubeBot extends Command {
aliases: ['yt'],
group: 'bot',
memberName: 'youtube',
- description: 'Gives you a link to the bot author\'s (Sin) YouTube profile.',
+ description: 'Gives you a link to uwufier\'s authors\' (Sin) YouTube profile.',
examples: ['uwu!youtube'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
diff --git a/src/server.ts b/src/server.ts
index b216ff4..f126f4e 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -17,6 +17,13 @@ class WebSocket {
}
// http://localhost:port?token=123456
registerRoots() {
+ this.app.all('*', function (req, res, next) {
+ res.header('Access-Control-Allow-Origin', '*');
+ res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
+ res.header('Access-Control-Allow-Headers', 'Content-Type');
+ next();
+ });
+
this.app.get('/', (req, res) => {
res.redirect('https://kyzer.co/discord/bots/uwufier/')
})