Skip to content

Commit

Permalink
Push alpha source of v4.0.0
Browse files Browse the repository at this point in the history
Pushed all source files for the v4.0.0-Alpha release.
  • Loading branch information
Gisgar3 committed Feb 1, 2019
1 parent 95ec639 commit b8a7047
Show file tree
Hide file tree
Showing 351 changed files with 58,576 additions and 49 deletions.
6 changes: 4 additions & 2 deletions commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"/ratz gitrepoinfo + {GitHubUsername}/{RepositoryName}",
"/ratz showactiveevent",
"/ratz joinactiveevent",
"/ratz getremovedmessages [DM-Channel Command]"
"/ratz getremovedmessages [DM-Channel Command]",
"/ratz machineinfo"
],
"definitions": [
"Shows all commands for ratzBot",
Expand All @@ -33,6 +34,7 @@
"Show information for provided GitHub repository (which is owned by the provided GitHub username)",
"Shows active server event",
"Join active server event",
"Gets all removed messages that were created by the user; given by ratzBot in a DM-Channel"
"Gets all removed messages that were created by the user; given by ratzBot in a DM-Channel",
"Gets all information regarding ratzBot's host machine"
]
}
80 changes: 39 additions & 41 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// COPYRIGHT (C) GAVIN ISGAR 2017-2018
// COPYRIGHT (C) GAVIN ISGAR 2017-2019
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
Expand All @@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
var _ = { label: 0, sent: function () { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
Expand Down Expand Up @@ -46,10 +46,10 @@ var net = require('net');
var http = require("http");
var url = require("url");
var path = require("path");
var cryptog = require("crypto");
var request = require("request");
var commands = require("./commands.json");
//var tokens = require("./exclude/tokens.json");
var tokens = require("C:/Users/Gavin/Desktop/tokens.json");
var tokens = require("./exclude/tokens.json");
var fs = require("fs");
var os = require("os");
var readline = require("readline");
Expand Down Expand Up @@ -197,52 +197,50 @@ bot.on('message', function (message) {
});
}
if (message.content.toString() == "/ratz releaseinfo") {
var getReleaseInfo = {
method: "GET",
url: "https://api.github.com/repos/Gisgar3/ratzBot/releases",
headers: {
"User-Agent": "Gisgar3"
}
};
request(getReleaseInfo, function (error, response, body) {
try {
if (!error && response.statusCode == 200) {
var stats = JSON.parse(body);
try {
request.post({
url: "https://api.github.com/graphql",
json: true,
body: {"query": "query { repository(owner: \"Gisgar3\", name: \"ratzBot\") { releases(last: 1) {nodes {author {name login avatarUrl} url tagName name publishedAt isPrerelease description} } } }"},
headers: {
"User-Agent": "Gisgar3",
"Authorization": `bearer ${tokens.githubpersonaltoken}`
}
}, function (err, httpResponse, body) {
if (!err && httpResponse.statusCode == 200) {
var embed = new Discord.RichEmbed()
.setTitle("ratzBot GitHub Release Information")
.setThumbnail(bot.user.avatarURL)
.setColor(0xcb00ff)
.setURL(stats[0].html_url)
.addField("Latest Release", "" + stats[0].name)
.addField("Release Branch", "" + stats[0].target_commitish)
.addField("Tag", stats[0].tag_name)
.addField("Changelog", stats[0].body)
.addField("Pre-Release Status", "" + stats[0].prerelease)
.addField("Author", stats[0].author.login);
if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-RC")) {
embed.setFooter("BUILD STAGE: Release Candidate");
.setURL(body.data.repository.releases.nodes[0].url)
.addField("Latest Release", body.data.repository.releases.nodes[0].name)
.addField("Tag", body.data.repository.releases.nodes[0].tagName)
.addField("Changelog", body.data.repository.releases.nodes[0].description)
.addField("Pre-Release Status", body.data.repository.releases.nodes[0].isPrerelease)
.addField("Author", `${body.data.repository.releases.nodes[0].author.name} (${body.data.repository.releases.nodes[0].author.login})`);
if (body.data.repository.releases.nodes[0].isPrerelease == true && body.data.repository.releases.nodes[0].tagName.endsWith("-RC")) {
embed.setFooter("BUILD STAGE: Release Candidate", body.data.repository.releases.nodes[0].author.avatarUrl);
}
else if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-Beta")) {
embed.setFooter("BUILD STAGE: Beta");
else if (body.data.repository.releases.nodes[0].isPrerelease == true && body.data.repository.releases.nodes[0].tagName.endsWith("-Beta")) {
embed.setFooter("BUILD STAGE: Beta", body.data.repository.releases.nodes[0].author.avatarUrl);
}
else if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-Alpha")) {
embed.setFooter("BUILD STAGE: Alpha");
else if (body.data.repository.releases.nodes[0].isPrerelease == true && body.data.repository.releases.nodes[0].tagName.endsWith("-Alpha")) {
embed.setFooter("BUILD STAGE: Alpha", body.data.repository.releases.nodes[0].author.avatarUrl);
}
else if ("" + stats[0].prerelease == "false") {
embed.setFooter("BUILD STAGE: General Availability");
else if (body.data.repository.releases.nodes[0].isPrerelease == false) {
embed.setFooter("BUILD STAGE: General Availability", body.data.repository.releases.nodes[0].author.avatarUrl);
}
message.channel.send(embed);
}
}
else {
message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006));
appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, error);
sendError(TYPE.BACKEND, RATZx0000006);
appendError(TYPE.BACKEND, RATZx0000006, message.author.id, err);
}
}
catch (err) {
message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006));
appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, err);
}
});
});
}
catch (err) {
appendError(TYPE.BACKEND, RATZx0000006, "SYSTEM", err)
}
}
if (message.content.toString() == "/ratz machineinfo") {
var embed = new Discord.RichEmbed()
Expand Down Expand Up @@ -707,4 +705,4 @@ function teachAI() {
}
});
});
}
}
24 changes: 20 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// COPYRIGHT (C) GAVIN ISGAR 2017-2018
// COPYRIGHT (C) GAVIN ISGAR 2017-2019

var Discord = require("discord.js");
var DiscordRPC = require("discord-rpc");
Expand All @@ -8,14 +8,15 @@ var ffmpeg = require("ffmpeg-binaries");
var ytdl = require("ytdl-core");
var bot = new Discord.Client();
var msg = new Discord.Message();
var { graphql, buildSchema } = require("graphql");
var net = require('net');
var http = require("http");
var url = require("url");
var path = require("path");
var cryptog = require("crypto");
var request = require("request");
var commands = require("./commands.json");
//var tokens = require("./exclude/tokens.json");
var tokens = require("C:/Users/Gavin/Desktop/tokens.json");
var tokens = require("./exclude/tokens.json");
var fs = require("fs");
var os = require("os");
var readline = require("readline");
Expand Down Expand Up @@ -162,6 +163,21 @@ bot.on('message', function (message) {
}
});
}
if (message.content.toString() == "/ratz releaseinfo2") {
var query = '{ repository(owner: \"Gisgar3\", name: \"ratzBot\") { issues(first: 2) { edges { node { bodyText } } } } }';
request.post({
url: "https://api.github.com/graphql",
form: "{ \"query\": \"" + query + "\"}",
headers: {
"User-Agent": "Gisgar3",
"Authorization": "bearer "
}
},
function (err, httpResponse, body) {
console.log(httpResponse);
});

}
if (message.content.toString() == "/ratz releaseinfo") {
var getReleaseInfo = {
method: "GET",
Expand Down Expand Up @@ -487,7 +503,7 @@ bot.on('message', function (message) {
}
if (message.content.includes("NIGGER") || message.content.includes("nigger") || message.content.includes("NIGGA") || message.content.includes("nigga")) {
fs.appendFileSync("./exclude/bannedmessages.ratz", "\r\n(" + message.author.username + " [" + message.author.id + "], " + message.createdTimestamp + ") " + message.content.toString());
message["delete"]();
message["delete"]();
message.channel.send(message.author + ", your message was deleted because it possibly relates to a blocked topic. To appeal the deletion of your message, contact an administrator.");
}
// --------------------------------
Expand Down
21 changes: 21 additions & 0 deletions node_modules/graphql/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

145 changes: 145 additions & 0 deletions node_modules/graphql/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b8a7047

Please sign in to comment.