mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2025-10-19 12:14:01 -04:00
Compare commits
112 Commits
Author | SHA1 | Date | |
---|---|---|---|
5b808e8873 | |||
9293af28dc | |||
|
97ca10f53e | ||
c9a68dfed6 | |||
0473958a16 | |||
|
04472c5192 | ||
|
6328d8508e | ||
|
2f440ec6ff | ||
|
8831641bce | ||
c03c964ac0 | |||
889f62d66f | |||
352d001dc2 | |||
|
0801ef2ea6 | ||
|
4a465bbe95 | ||
|
7caf8524cb | ||
|
a19bb6b17e | ||
178f93ad3f | |||
adc258fb1d | |||
4152a32ef7 | |||
494f345d05 | |||
|
09fbe7a5d7 | ||
|
26a1cf9571 | ||
|
79cc4838e4 | ||
5a83b5097d | |||
ffb9e943a5 | |||
ab91e14dfc | |||
7a96ffe960 | |||
0c9954a41f | |||
aeb04580e0 | |||
980161af4c | |||
14cd7fd7c9 | |||
|
e334febf08 | ||
f5bbbdf533 | |||
9f16f04e20 | |||
|
3573141963 | ||
97970c23f8 | |||
0796d13937 | |||
a3fe0af8ad | |||
8544676e74 | |||
35576298e8 | |||
f900652347 | |||
51fdae02d6 | |||
84d1b62309 | |||
e2b95f5aec | |||
deb0118652 | |||
601dc1755a | |||
a8abbd0174 | |||
a3dde7383a | |||
15badc68c8 | |||
ea85a8da9e | |||
85398fc4e0 | |||
0c14891aba | |||
a9cf34717b | |||
03a9b72247 | |||
d82de68c70 | |||
7af1e4b483 | |||
e5a0077ff4 | |||
136b88a77d | |||
e86016c322 | |||
4a59ad7103 | |||
349ad4d926 | |||
1b7dcedca2 | |||
cedf3c6d72 | |||
4e334c1459 | |||
dad83d5001 | |||
8a1bc2137b | |||
c6fb55a097 | |||
a4e30196be | |||
|
d1749c7760 | ||
|
5a42a3e11a | ||
c15ddaa8ed | |||
275493b0f5 | |||
3a84baa944 | |||
4a7e7ea431 | |||
b28ed796d6 | |||
9239d10a6f | |||
abb41e182e | |||
02f9f7e643 | |||
fdb14602c3 | |||
007e46b135 | |||
b75e153a1a | |||
174737a4a4 | |||
76d24311f0 | |||
95e85be5de | |||
3bb8fc6d76 | |||
2aa12d057c | |||
|
816118633d | ||
c8e2828043 | |||
167d69e564 | |||
b155c84cfc | |||
|
7ff29383a2 | ||
2b98f98b1c | |||
41d0ad4f58 | |||
793239ed36 | |||
000a629bff | |||
be11882ba4 | |||
cc72efadce | |||
f490760d11 | |||
b3b6da7775 | |||
51b5d48d4a | |||
2825436969 | |||
|
ccb79f1233 | ||
|
866756dfb2 | ||
|
9cef57c075 | ||
|
e0d2b5d291 | ||
|
80c6a2fe8c | ||
5c2692b660 | |||
3f9532cf56 | |||
91f4c849eb | |||
b0d6c6490e | |||
dac06d57e1 | |||
6732fe4db5 |
17
.github/workflows/dockerimage.yml
vendored
17
.github/workflows/dockerimage.yml
vendored
@@ -1,17 +0,0 @@
|
||||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag osselbot:$(date +%s)
|
20
.github/workflows/dockerpub.yml
vendored
20
.github/workflows/dockerpub.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Publish Docker image
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to GitHub Packages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Push to GitHub Packages
|
||||
uses: docker/build-push-action@v1
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: docker.pkg.github.com
|
||||
repository: techniclor-creamsicle/osselbot/osselbot
|
||||
tag_with_ref: true
|
20
.github/workflows/dockerpub3.yml
vendored
20
.github/workflows/dockerpub3.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Publish Docker image
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to GitHub Packages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Push to GitHub Packages
|
||||
uses: docker/build-push-action@v1
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: docker.pkg.github.com
|
||||
repository: techniclor-creamsicle/osselbot/osselbot
|
||||
tag_with_ref: true
|
20
.gitignore
vendored
20
.gitignore
vendored
@@ -1 +1,19 @@
|
||||
node_modules/
|
||||
# Files and directories created by pub
|
||||
.dart_tool/
|
||||
.packages
|
||||
|
||||
# Conventional directory for build outputs
|
||||
build/
|
||||
|
||||
# Directory created by dartdoc
|
||||
doc/api/
|
||||
|
||||
# Vscode settings
|
||||
.vscode
|
||||
|
||||
# MacOS being funky
|
||||
.DS_Store
|
||||
|
||||
# Config file and executeables
|
||||
lib/config.dart
|
||||
bin/osselbot.exe
|
||||
|
3
CHANGELOG.md
Normal file
3
CHANGELOG.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.0
|
||||
|
||||
- Initial version, created by Stagehand
|
17
Dockerfile
17
Dockerfile
@@ -1,17 +0,0 @@
|
||||
# Use the official image as a parent image.
|
||||
FROM node:current-slim
|
||||
|
||||
# Set the working directory.
|
||||
WORKDIR ./DOCKER
|
||||
|
||||
# Copy the file from your host to your current location.
|
||||
COPY ./package.json .
|
||||
COPY ./package-lock.json .
|
||||
# Run the command inside your image filesystem.
|
||||
RUN npm install
|
||||
|
||||
# Run the specified command within the container.
|
||||
CMD [ "npm", "start" ]
|
||||
|
||||
# Copy the rest of your app's source code from your host to your image filesystem.
|
||||
COPY ./src/ .
|
@@ -1,5 +1,4 @@
|
||||
# Osselbot
|
||||
A bot that is kinda stupid but it works surprisingly well
|
||||
A simple command-line application.
|
||||
|
||||
|
||||

|
||||
Created from templates made available by Stagehand under a BSD-style
|
||||
[license](https://github.com/dart-lang/stagehand/blob/master/LICENSE).
|
||||
|
19
analysis_options.yaml
Normal file
19
analysis_options.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
# Defines a default set of lint rules enforced for
|
||||
# projects at Google. For details and rationale,
|
||||
# see https://github.com/dart-lang/pedantic#enabled-lints.
|
||||
|
||||
include: package:pedantic/analysis_options.yaml
|
||||
|
||||
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
|
||||
# Uncomment to specify additional rules.
|
||||
linter:
|
||||
rules:
|
||||
- camel_case_types
|
||||
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
implicit-casts: false
|
||||
implicit-dynamic: false
|
||||
# exclude:
|
||||
# - path/to/excluded/files/**
|
111
bin/osselbot.dart
Normal file
111
bin/osselbot.dart
Normal file
@@ -0,0 +1,111 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:nyxx/nyxx.dart';
|
||||
import 'package:nyxx_commander/commander.dart';
|
||||
import 'package:nyxx_interactions/interactions.dart';
|
||||
import 'package:osselbot/config.dart';
|
||||
// import 'package:path/path.dart';
|
||||
|
||||
void main(List<String> arguments) {
|
||||
final bot = Nyxx(Config['token'] as String, 32511);
|
||||
bot.onReady.listen((event) {
|
||||
randomStatus(bot);
|
||||
});
|
||||
|
||||
// Change the Activity every 5 minutes
|
||||
Timer.periodic(Duration(minutes: 5), (timer) => randomStatus(bot));
|
||||
|
||||
Interactions(bot)
|
||||
..registerSlashCommand(SlashCommandBuilder(
|
||||
'info',
|
||||
'gives bot info',
|
||||
[],
|
||||
)..registerHandler((handler) => infoSlashCommand(handler, bot)))
|
||||
..syncOnReady();
|
||||
|
||||
Commander(bot, prefix: '?')
|
||||
..registerCommand(
|
||||
'ping',
|
||||
(context, message) => {
|
||||
context.reply(MessageBuilder.content('pong! ' +
|
||||
bot.shardManager.shards
|
||||
.elementAt(context.shardId)
|
||||
.gatewayLatency
|
||||
.inMilliseconds
|
||||
.toString() +
|
||||
'ms'))
|
||||
})
|
||||
..registerCommand('info', (context, message) async {
|
||||
await context.sendMessage(MessageBuilder.embed(
|
||||
await infoCommand(bot, context.guild, context.shardId)));
|
||||
});
|
||||
}
|
||||
|
||||
// Bot routines
|
||||
|
||||
DiscordColor getColor(Member? member) {
|
||||
if (member == null) return DiscordColor.black;
|
||||
member.roles.forEach((element) async {
|
||||
await element.getOrDownload();
|
||||
});
|
||||
|
||||
var colorRole = member.roles.firstWhere((element) {
|
||||
if (element.getFromCache()?.color == null) return false;
|
||||
return element.getFromCache()?.color != DiscordColor.none;
|
||||
});
|
||||
return colorRole.getFromCache()!.color;
|
||||
}
|
||||
|
||||
void randomStatus(Nyxx bot) {
|
||||
var rand = Random();
|
||||
var statuses = Config['statuses'] as List<String>;
|
||||
|
||||
bot.setPresence(PresenceBuilder.of(
|
||||
status: UserStatus.dnd,
|
||||
game: Activity.of(statuses[rand.nextInt(statuses.length - 1)])));
|
||||
}
|
||||
|
||||
// Command embeds
|
||||
|
||||
// Info
|
||||
Future<EmbedBuilder> infoCommand(Nyxx bot, Guild? guild, int? shardId) async {
|
||||
var member = await guild!.fetchMember(bot.self.id);
|
||||
|
||||
var color = getColor(member);
|
||||
var iconUrl = bot.self.avatarURL();
|
||||
int ping;
|
||||
|
||||
if (shardId != null) {
|
||||
ping = bot.shardManager.shards
|
||||
.elementAt(shardId)
|
||||
.gatewayLatency
|
||||
.inMilliseconds;
|
||||
} else {
|
||||
ping = bot.shardManager.gatewayLatency.inMilliseconds;
|
||||
}
|
||||
|
||||
var uptimeString = bot.uptime.toString();
|
||||
|
||||
return EmbedBuilder()
|
||||
..addField(name: 'Ping', content: ping.toString() + 'ms', inline: true)
|
||||
..addField(
|
||||
name: 'Uptime',
|
||||
content: uptimeString.substring(0, uptimeString.length - 7),
|
||||
inline: true)
|
||||
..addAuthor((author) {
|
||||
author.iconUrl = iconUrl;
|
||||
author.name = bot.self.username;
|
||||
})
|
||||
..color = color;
|
||||
}
|
||||
|
||||
// Command helpers
|
||||
|
||||
// /info command
|
||||
Future<void> infoSlashCommand(InteractionEvent event, Nyxx bot) async {
|
||||
await event.acknowledge();
|
||||
|
||||
await event.respond(MessageBuilder.embed(await infoCommand(
|
||||
bot, await event.interaction.guild!.getOrDownload(), null)));
|
||||
}
|
10
build.sh
10
build.sh
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#logs in as Alex
|
||||
cat ~/.GHTOKEN | docker login https://docker.pkg.github.com -u technicolor-creamsicle --password-stdin
|
||||
#Builds the package
|
||||
docker build --tag osselbot .
|
||||
#pushes to github
|
||||
docker tag osselbot:latest docker.pkg.github.com/techniclor-creamsicle/osselbot/osselbot:$1
|
||||
docker push docker.pkg.github.com/techniclor-creamsicle/osselbot/osselbot:$1
|
||||
|
||||
echo build may have passed using version: $1
|
3
lib/config.dart
Normal file
3
lib/config.dart
Normal file
@@ -0,0 +1,3 @@
|
||||
Map<String, dynamic> Config = <String, dynamic>{
|
||||
'token': 'EXAMPLE TOKEN',
|
||||
};
|
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "Updating"
|
||||
#Update Node Based stuff
|
||||
cd /home/ec2-user/github/Osselbot/
|
||||
nvm node
|
||||
npm upgrade
|
||||
#update code
|
||||
git pull --force
|
||||
#Starts the bot
|
||||
cd ./src
|
||||
echo "STARTING"
|
||||
node index.js
|
286
old stuff/old.js
286
old stuff/old.js
@@ -1,286 +0,0 @@
|
||||
|
||||
|
||||
// Here we load the config.json file that contains our token and our prefix values.
|
||||
const config = require("./config.json");
|
||||
// config.token contains the bot's token
|
||||
// config.prefix contains the message prefix.
|
||||
|
||||
//Activity setting
|
||||
|
||||
client.on('guildMemberAdd', member => {
|
||||
console.log(`New member joined: ${member.name} (id: ${member.id}).`);
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
});
|
||||
client.on('guildMemberRemove', member => {
|
||||
console.log(` member left: ${member.name} (id: ${member.id}).`);
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
});
|
||||
client.on("guildDelete", guild => {
|
||||
// this event triggers when the bot is removed from a guild.
|
||||
console.log(`I have been removed from: ${guild.name} (id: ${guild.id})`);
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
});
|
||||
|
||||
//Actual command stuff
|
||||
client.on("message", async message => {
|
||||
// This event will run on every single message received, from any channel or DM.
|
||||
|
||||
|
||||
// It's good practice to ignoe other bots. This also makes your bot ignore itself
|
||||
// and not get into a spam loop (we call that "botception ").
|
||||
if(message.author.bot) return;
|
||||
|
||||
//people are assholes so this blocks it!
|
||||
if(message.content.toLowerCase().includes('nigger',"nigga","niglet","nigglet")){
|
||||
message.member.roles.add('654366653093642241').catch(console.error);
|
||||
message.member.roles.remove('514254335425773589').catch(console.error);
|
||||
console.log(`${message.member} has been detained`)
|
||||
return message.reply('Member has been D E T A I N E D <:yikes:632660765878255636>')
|
||||
}
|
||||
|
||||
// Also good practice to ignore any message that does not start with our prefix,
|
||||
// which is set in the configuration file.
|
||||
if(message.content.indexOf(config.prefix) !== 0) return;
|
||||
|
||||
// Here we separate our "command" name, and our "arguments" for the command.
|
||||
// e.g. if we have the message "+say Is this the real life?" , we'll get the following:
|
||||
// command = say
|
||||
// args = ["Is", "this", "the", "real", "life?"]
|
||||
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
|
||||
const command = args.shift().toLowerCase();
|
||||
|
||||
// Let's go with a few common example commands! Feel free to delete or change those.
|
||||
|
||||
if(command === "ping") {
|
||||
// Calculates ping between sending a message and editing it, giving a nice round-trip latency.
|
||||
// The second ping is an average latency between the bot and the websocket server (one-way, not round-trip)
|
||||
const m = await message.channel.send("Ping?");
|
||||
m.edit(`Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms`);
|
||||
}
|
||||
|
||||
if(command === "say") {
|
||||
// makes the bot say something and delete the message. As an example, it's open to anyone to use.
|
||||
// To get the "message" itself we join the `args` back into a string with spaces:
|
||||
const sayMessage = args.join(" ");
|
||||
if (message.member.roles.cache.some(r=>["Admin", "Mods","Member of the Order of the b l u e","Botmeister","Ally of the Order","say"].includes(r.name)) ){
|
||||
if(sayMessage.includes('@')) {
|
||||
return message.reply("\nStop pinging yourself \nStop pinging yourself");
|
||||
}
|
||||
// Then we delete the command message (sneaky, right?). The catch just ignores the error with a cute smiley thing.
|
||||
message.delete().catch(O_o=>{});
|
||||
// And we get the bot to say the thing:
|
||||
return message.channel.send(sayMessage);
|
||||
}
|
||||
else {
|
||||
return message.channel.send("Im sorry but we cant have nice things...")
|
||||
}
|
||||
}
|
||||
if(command === "kick") {
|
||||
// This command must be limited to mods and admins. In this example we just hardcode the role names.
|
||||
// Please read on Array.some() to understand this bit:
|
||||
// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/some?
|
||||
if(!message.member.roles.cache.some(r=>["Admin", "Moderator","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
|
||||
return message.reply("Sorry, you don't have permissions to use this!");
|
||||
|
||||
// Let's first check if we have a member and if we can kick them!
|
||||
// message.mentions.members is a collection of people that have been mentioned, as GuildMembers.
|
||||
// We can also support getting the member by ID, which would be args[0]
|
||||
let member = message.mentions.members.first() || message.guild.members.get(args[0]);
|
||||
if(!member)
|
||||
return message.reply("Please mention a valid member of this server");
|
||||
if(!member.kickable)
|
||||
return message.reply("I cannot kick this user! Do they have a higher role? Do I have kick permissions?");
|
||||
|
||||
// slice(1) removes the first part, which here should be the user mention or ID
|
||||
// join(' ') takes all the various parts to make it a single string.
|
||||
let reason = args.slice(1).join(' ');
|
||||
if(!reason) reason = "No reason provided";
|
||||
|
||||
// Now, time for a swift kick in the nuts!
|
||||
await member.kick(reason)
|
||||
.catch(error => message.reply(`Sorry ${message.author} I couldn't kick because of : ${error}`));
|
||||
message.reply(`${member.user.tag} has been kicked by ${message.author.tag} because: ${reason}`);
|
||||
}
|
||||
if(command === "ban") {
|
||||
// Most of this command is identical to kick, except that here we'll only let admins do it.
|
||||
// In the real world mods could ban too, but this is just an example, right? ;)
|
||||
if(!message.member.roles.cache.some(r=>["Administrator","Member of the Order of the b l u e"].includes(r.name)) )
|
||||
return message.reply("Sorry, you don't have permissions to use this!");
|
||||
|
||||
let member = message.mentions.members.first();
|
||||
if(!member)
|
||||
return message.reply("Please mention a valid member of this server");
|
||||
if(!member.bannable)
|
||||
return message.reply("I cannot ban this user! Do they have a higher role? Do I have ban permissions?");
|
||||
|
||||
let reason = args.slice(1).join(' ');
|
||||
if(!reason) reason = "No reason provided";
|
||||
|
||||
await member.ban(reason)
|
||||
.catch(error => message.reply(`Sorry ${message.author} I couldn't ban because of : ${error}`));
|
||||
message.reply(`${member.user.tag} has been banned by ${message.author.tag} because: ${reason}`);
|
||||
}
|
||||
if(command === "purge") {
|
||||
//Vibe check
|
||||
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
|
||||
return message.reply("Sorry, you don't have permissions to use this!");
|
||||
// This command removes all messages from all users in the channel, up to 100.
|
||||
else {
|
||||
// get the delete count, as an actual number.
|
||||
const deleteCount = parseInt(args[0], 10);
|
||||
|
||||
// Ooooh nice, combined conditions. <3
|
||||
if(!deleteCount || deleteCount < 2 || deleteCount > 100)
|
||||
return message.reply("Please provide a number between 2 and 100 for the number of messages to delete");
|
||||
|
||||
// So we get our messages, and delete them. Simple enough, right?
|
||||
const fetched = await message.channel.messages.fetch({limit: deleteCount});
|
||||
message.channel.bulkDelete(fetched)
|
||||
.catch(error => message.reply(`Couldn't delete messages because of: ${error}`));
|
||||
}
|
||||
};
|
||||
if(command === "detain") {
|
||||
//For Civilians all partying
|
||||
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
|
||||
return message.reply("Sorry, you don't have permissions to use this!");
|
||||
|
||||
let member = message.mentions.members.first();
|
||||
if(!member)
|
||||
return message.reply("Please mention a valid member of this server");
|
||||
else {
|
||||
member.roles.add('654366653093642241').catch(console.error);
|
||||
member.roles.remove('514254335425773589').catch(console.error);
|
||||
return message.reply("Member has been D E T A I N E D<:yikes:632660765878255636>\n**DEFCON** level increased\nGod Bless their souls")
|
||||
}
|
||||
}
|
||||
if(command === "retain") {
|
||||
//For Civilians all partying
|
||||
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
|
||||
return message.reply("Sorry, you don't have permissions to use this!");
|
||||
|
||||
let member = message.mentions.members.first();
|
||||
if(!member)
|
||||
return message.reply("Please mention a valid member of this server");
|
||||
else {
|
||||
member.roles.add('514254335425773589').catch(console.error);
|
||||
member.roles.remove('654366653093642241').catch(console.error);
|
||||
return message.reply("Member has been R E T A I N E D <:MilkTurtle:628399622678773760>")
|
||||
}
|
||||
}
|
||||
// HERE COMES SHITTY COMMANDS MADE BY YOURS TRUELY
|
||||
if(command === 'help') {
|
||||
return message.reply('https://technicolor.2a03.party/bot/');
|
||||
};
|
||||
if(command === "rand") {
|
||||
//Generates random number between 1-100
|
||||
min = Math.ceil(0);
|
||||
max = Math.floor(101);
|
||||
return message.channel.send(Math.floor(Math.random() * (max - min)) + min); //The maximum is exclusive and the minimum is inclusive
|
||||
};
|
||||
if(command === "oath") {
|
||||
return message.reply("The cadet oath is as follows.\nI pledge that I will serve faithfully in the Civil Air Patrol cadet program. That I will attend meetings regularly, wear my uniform properly, obey my officers, and advance my education and training rapidly to prepare myself to be of service to my community state and nation.");
|
||||
};
|
||||
if(command === "ask") {
|
||||
return message.channel.send("Dont Ask, Just ask!\n https://iki.fi/sol/dontask.html")
|
||||
};
|
||||
if(command === "damage") {
|
||||
return message.channel.send("https://cdn.discordapp.com/attachments/619631814696239142/678467158660874270/ohmydamage.mov")
|
||||
};
|
||||
if(command === "osseley") {
|
||||
return message.channel.send("Ohhh Osseley,\n how I missed you sooo much \nOne of these days...")
|
||||
};
|
||||
if(command === "psych") {
|
||||
return message.channel.send("Rules for finding a psychopath: \n1. Favorite color is orange \n2. Likes the left burners, worse if its top left\n3. Calls pizza sauce/tomato sauce gravy\n4. Doesnt like salad\n5. Likes country music\n6. Makes hot chocolate with water\n7. Likes black licorice")
|
||||
};
|
||||
if(command === "squad") {
|
||||
min = Math.ceil(0);
|
||||
max = Math.floor(11);
|
||||
let rate = Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
|
||||
return message.reply(`The squad rates this ${rate} out of 10`);
|
||||
};
|
||||
if(command === "magic") {
|
||||
return message.channel.send("Do you believe in magic in a young girl\'s heart\nHow the music can free her, whenever it starts\nAnd it\'s magic, if the music is groovy\nIt makes you feel happy like an old-time movie\nI\'ll tell you about the magic, and it\'ll free your soul\nBut it\'s like trying to tell a stranger bout \'rock and roll\'")
|
||||
}
|
||||
if(command === "simp") {
|
||||
if(!message.member.roles.cache.some(r=>["Admin", "Moderator","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
|
||||
return message.reply("Sorry, you don't have permissions to use this!");
|
||||
let embed = new Discord.MessageEmbed()
|
||||
.setTitle("SIMP Alert")
|
||||
.setURL("https://www.youtube.com/watch?v=c3m4Q07TkMk")
|
||||
.setColor(0x195080)
|
||||
.setDescription("__**ALERT**__ SIMP detected!")
|
||||
.setImage("https://vignette.wikia.nocookie.net/disney/images/6/64/Kronk_.jpg/revision/latest?cb=20160720194635")
|
||||
.setTimestamp()
|
||||
message.channel.send({embed})
|
||||
}
|
||||
//DEFCON Roles
|
||||
if(command === "defcon") {
|
||||
//5 levels till ban
|
||||
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
|
||||
return message.reply("Sorry, you don't have permissions to use this!");
|
||||
else {
|
||||
let member = message.mentions.members.first();
|
||||
var role = "";
|
||||
switch(parseInt(args[1],10)) {
|
||||
case 5:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 5`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
case 4:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 4`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
case 3:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 3`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
case 2:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 2`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
case 1:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 1`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
default:
|
||||
return message.reply(`DEFCON not set is ${args[1]} a number between 1-5?`)
|
||||
};
|
||||
return message.reply(`\n**DEFCON** level set to DEFCON ${args[1]}\nGod Bless their souls`)
|
||||
};
|
||||
};
|
||||
|
||||
if (command === "fix") {
|
||||
if(message.member.roles.cache.some(r=>["Botmeister"].includes(r.name))) {
|
||||
return message.channel.send("I guess it\'s my fault will fix.");
|
||||
};
|
||||
return;
|
||||
};
|
||||
if (command === "stats") {
|
||||
let embed = new Discord.MessageEmbed()
|
||||
.setTitle('Stats')
|
||||
.setColor(0x195080)
|
||||
.setDescription(`\
|
||||
**Stats for 0SSELB0T** \n \
|
||||
**Uptime:** ${prettyMilliseconds(client.uptime)} \n \
|
||||
**Started at:** ${client.readyAt} \n \
|
||||
**People:** ${client.users.cache.size}\
|
||||
`);
|
||||
return message.channel.send(embed);
|
||||
};
|
||||
if (command === "reboot"){
|
||||
function shutdown(){
|
||||
client.destroy();
|
||||
process.exit(69);
|
||||
}
|
||||
if (message.author.id === '216042720047661057') {
|
||||
message.reply("**Authenticated**, Restarting now.");
|
||||
client.user.setActivity(`Itself die`,{ type: 'WATCHING' });
|
||||
setTimeout(shutdown, 5000, 'shutdown');
|
||||
}
|
||||
else {
|
||||
return message.reply("No");
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
client.login(config.token)
|
@@ -1,17 +0,0 @@
|
||||
[Unit]
|
||||
Description="Osselbot coded for civilians all partying"
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/ec2-user/Osselbot/src/bot-start.sh
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
User=ec2-user
|
||||
# Note Debian/Ubuntu uses 'nogroup', RHEL/Fedora uses 'nobody'
|
||||
Group=nobody
|
||||
Environment=PATH=/usr/bin:/usr/local/bin
|
||||
Environment=NODE_ENV=production
|
||||
WorkingDirectory=/home/ec2-user/Osselbot/src/
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@@ -1,5 +0,0 @@
|
||||
const { ShardingManager } = require('discord.js');
|
||||
const manager = new ShardingManager('./bot.js', { token: 'Njc4MDkzNjY4NzcwNTEyOTE3.XkdyyA.6n4wvPmzOw-fwuysEoTPU8Cv2x0' });
|
||||
|
||||
manager.spawn();
|
||||
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
|
125
package-lock.json
generated
125
package-lock.json
generated
@@ -1,125 +0,0 @@
|
||||
{
|
||||
"name": "osselbot",
|
||||
"version": "1.1.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@discordjs/collection": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
|
||||
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
|
||||
},
|
||||
"@discordjs/form-data": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"abort-controller": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
||||
"requires": {
|
||||
"event-target-shim": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||
},
|
||||
"discord.js": {
|
||||
"version": "12.2.0",
|
||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.2.0.tgz",
|
||||
"integrity": "sha512-Ueb/0SOsxXyqwvwFYFe0msMrGqH1OMqpp2Dpbplnlr4MzcRrFWwsBM9gKNZXPVBHWUKiQkwU8AihXBXIvTTSvg==",
|
||||
"requires": {
|
||||
"@discordjs/collection": "^0.1.5",
|
||||
"@discordjs/form-data": "^3.0.1",
|
||||
"abort-controller": "^3.0.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"prism-media": "^1.2.0",
|
||||
"setimmediate": "^1.0.5",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"ws": "^7.2.1"
|
||||
}
|
||||
},
|
||||
"event-target-shim": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
||||
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.44.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
||||
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.27",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
|
||||
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
|
||||
"requires": {
|
||||
"mime-db": "1.44.0"
|
||||
}
|
||||
},
|
||||
"n": {
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/n/-/n-6.5.1.tgz",
|
||||
"integrity": "sha512-CSDShHuBlYHfS5PR4BxwkZYNrDnc3B7GCRdAhSvnzl681Pd4Y4qOOTWQqjB8Cp6gYOIQI9qJxLK0Q1YI4xO2Kg=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"parse-ms": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz",
|
||||
"integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA=="
|
||||
},
|
||||
"pretty-ms": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-6.0.1.tgz",
|
||||
"integrity": "sha512-ke4njoVmlotekHlHyCZ3wI/c5AMT8peuHs8rKJqekj/oR5G8lND2dVpicFlUz5cbZgE290vvkMuDwfj/OcW1kw==",
|
||||
"requires": {
|
||||
"parse-ms": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"prism-media": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.2.tgz",
|
||||
"integrity": "sha512-I+nkWY212lJ500jLe4tN9tWO7nRiBAVdMv76P9kffZjYhw20raMlW1HSSvS+MLXC9MmbNZCazMrAr+5jEEgTuw=="
|
||||
},
|
||||
"setimmediate": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
||||
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
|
||||
},
|
||||
"tweetnacl": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
||||
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
|
||||
},
|
||||
"ws": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
|
||||
"integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w=="
|
||||
}
|
||||
}
|
||||
}
|
26
package.json
26
package.json
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"name": "osselbot",
|
||||
"version": "1.1.0",
|
||||
"description": "Discordbot on Discord.js",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"discord.js": "^12.1.1",
|
||||
"n": "^6.4.0",
|
||||
"pretty-ms": "^6.0.1"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node ./index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Technicolor-creamsicle/Osselbot.git"
|
||||
},
|
||||
"author": "Alex Technicolor <technicolor@2a03.party> (http://technicolor.2a03.party)",
|
||||
"license": "SEE LICENSE IN LICENCE",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Technicolor-creamsicle/Osselbot/issues"
|
||||
},
|
||||
"homepage": "https://technicolor.2a03.party/bot"
|
||||
}
|
117
pubspec.lock
Normal file
117
pubspec.lock
Normal file
@@ -0,0 +1,117 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.7.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
http:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.13.3"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
nyxx:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: nyxx
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0-rc.5"
|
||||
nyxx_commander:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: nyxx_commander
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0-rc.8"
|
||||
nyxx_interactions:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: nyxx_interactions
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0-rc.6"
|
||||
path:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.11.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
sdks:
|
||||
dart: ">=2.12.0 <3.0.0"
|
18
pubspec.yaml
Normal file
18
pubspec.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
name: osselbot
|
||||
description: A stupid discord bot made for stupid people.
|
||||
version: 3.0.0
|
||||
homepage: https://nicolor.tech/bot
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
|
||||
dependencies:
|
||||
nyxx: ^2.0.0-rc.5
|
||||
nyxx_interactions: ^2.0.0-rc.5
|
||||
nyxx_commander: ^2.0.0-rc.5
|
||||
path: ^1.7.0
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
pedantic: ^1.9.0
|
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU",
|
||||
"prefix" : ";"
|
||||
}
|
156
src/index.js
156
src/index.js
@@ -1,156 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
// Load up the libraries
|
||||
const Discord = require("discord.js");
|
||||
const prettyMilliseconds = require('pretty-ms');
|
||||
const config = require("./config.json");
|
||||
// This is the client
|
||||
const client = new Discord.Client();
|
||||
client.on("ready", () => {
|
||||
// This event will run if the bot starts, and logs in, successfully.
|
||||
console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`);
|
||||
// Example of changing the bot's playing game to something useful. `client.user` is what the
|
||||
// docs refer to as the "ClientUser".
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
});
|
||||
//Updates people count
|
||||
client.on('guildMemberAdd', member => {
|
||||
console.log(`New member joined: ${member.name} (id: ${member.id}).`);
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
});
|
||||
client.on('guildMemberRemove', member => {
|
||||
console.log(` member left: ${member.name} (id: ${member.id}).`);
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
});
|
||||
////// ACTUAL MESSAGE PROCESSING
|
||||
client.on("message", async message => {
|
||||
//stops bots from activating the Osselbot
|
||||
//Message processing
|
||||
if(message.author.bot) return;
|
||||
if(message.content.indexOf(config.prefix) !== 0) return;
|
||||
// Here we separate our "command" name, and our "arguments" for the command.
|
||||
// e.g. if we have the message "+say Is this the real life?" , we'll get the following:
|
||||
// command = say
|
||||
// args = ["Is", "this", "the", "real", "life?"]
|
||||
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
|
||||
const command = args.shift().toLowerCase();
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//COMMAND TIME
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
if (command === "reboot"){
|
||||
function shutdown(){
|
||||
client.destroy();
|
||||
process.exit(69);
|
||||
}
|
||||
if (message.author.id === '216042720047661057') {
|
||||
message.reply("**Authenticated**, Restarting now.");
|
||||
client.user.setActivity(`Itself die`,{ type: 'WATCHING' });
|
||||
setTimeout(shutdown, 5000, 'shutdown');
|
||||
}
|
||||
else {
|
||||
return message.reply("No");
|
||||
};
|
||||
};
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
if (command === "stats") {
|
||||
let embed = new Discord.MessageEmbed()
|
||||
.setTitle('Stats')
|
||||
.setColor(0x195080)
|
||||
.setDescription(`\
|
||||
**Stats for 0SSELB0T** \n \
|
||||
**Uptime:** ${prettyMilliseconds(client.uptime)} \n \
|
||||
**Started at:** ${client.readyAt} \n \
|
||||
**People:** ${client.users.cache.size}\
|
||||
`);
|
||||
return message.channel.send(embed);
|
||||
};
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
if(command === "ping") {
|
||||
// Calculates ping between sending a message and editing it, giving a nice round-trip latency.
|
||||
const m = await message.channel.send("Ping?");
|
||||
m.edit(`Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms`);
|
||||
};
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//HOW QUOTEABLE
|
||||
if(command === "psych") {
|
||||
return message.channel.send("Rules for finding a psychopath: \n1. Favorite color is orange \n2. Likes the left burners, worse if its top left\n3. Calls pizza sauce/tomato sauce gravy\n4. Doesnt like salad\n5. Likes country music\n6. Makes hot chocolate with water\n7. Likes black licorice")
|
||||
};
|
||||
|
||||
if(command === "ask") {
|
||||
return message.channel.send("Dont Ask, Just ask!\n https://iki.fi/sol/dontask.html")
|
||||
};
|
||||
|
||||
if(command === "simp") {
|
||||
if(!message.member.roles.cache.some(r=>["Admin", "Moderator","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
|
||||
return message.reply("Sorry, you don't have permissions to use this!");
|
||||
let embed = new Discord.MessageEmbed()
|
||||
.setTitle("SIMP Alert")
|
||||
.setURL("https://www.youtube.com/watch?v=c3m4Q07TkMk")
|
||||
.setColor(0x195080)
|
||||
.setDescription("__**ALERT**__ SIMP detected!")
|
||||
.setImage("https://vignette.wikia.nocookie.net/disney/images/6/64/Kronk_.jpg/revision/latest?cb=20160720194635")
|
||||
.setTimestamp()
|
||||
message.channel.send({embed})
|
||||
};
|
||||
|
||||
if(command === "squad") {
|
||||
min = Math.ceil(0);
|
||||
max = Math.floor(11);
|
||||
let rate = Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
|
||||
return message.reply(`The squad rates this ${rate} out of 10`);
|
||||
};
|
||||
|
||||
if(command === "magic") {
|
||||
return message.channel.send("Do you believe in magic in a young girl\'s heart\nHow the music can free her, whenever it starts\nAnd it\'s magic, if the music is groovy\nIt makes you feel happy like an old-time movie\nI\'ll tell you about the magic, and it\'ll free your soul\nBut it\'s like trying to tell a stranger bout \'rock and roll\'");
|
||||
};
|
||||
|
||||
if(command === 'help') {
|
||||
return message.reply('https://technicolor.2a03.party/bot/');
|
||||
};
|
||||
|
||||
if (command === "fix") {
|
||||
if(message.member.roles.cache.some(r=>["Botmeister"].includes(r.name))) {
|
||||
return message.channel.send("I guess it\'s my fault will fix.");
|
||||
};
|
||||
return;
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////DEFCON//////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
if(command === "defcon") {
|
||||
//5 levels till ban
|
||||
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
|
||||
return message.reply("Sorry, you don't have permissions to use this!");
|
||||
else {
|
||||
let member = message.mentions.members.first();
|
||||
var role = "";
|
||||
switch(parseInt(args[1],10)) {
|
||||
case 5:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 5`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
case 4:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 4`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
case 3:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 3`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
case 2:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 2`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
case 1:
|
||||
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 1`);
|
||||
member.roles.add(role);
|
||||
break;
|
||||
default:
|
||||
return message.reply(`DEFCON not set is ${args[1]} a number between 1-5?`)
|
||||
};
|
||||
return message.reply(`\n**DEFCON** level set to DEFCON ${args[1]}\nGod Bless their souls`)
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
//Logging in the bot
|
||||
client.login(config.token)
|
Reference in New Issue
Block a user