Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #78 from Butterstroke/development
Browse files Browse the repository at this point in the history
Version 1.6.2
  • Loading branch information
AurelicButter authored Jul 21, 2021
2 parents 4af41e9 + 1c6adc3 commit 32adbee
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 42 deletions.
34 changes: 17 additions & 17 deletions assets/settingsExample.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"token": "Token Key",
"prefix": "Prefix",
"build": {
"version": "Release 1.6.0",
"releaseDate": "April 27th, 2021"
},
"database": "./assets/MargarineData.sqlite",
"dateOptions": {
"lang": "en-CA",
"display": {
"year": "numeric",
"month": "long",
"day": "numeric",
"hour": "numeric",
"minute": "numeric"
}
}
"token": "Token Key",
"prefix": "Prefix",
"build": {
"version": "Release 1.6.2",
"releaseDate": "July 20th, 2021"
},
"database": "./assets/MargarineData.sqlite",
"dateOptions": {
"lang": "en-CA",
"display": {
"year": "numeric",
"month": "long",
"day": "numeric",
"hour": "numeric",
"minute": "numeric"
}
}
}
42 changes: 23 additions & 19 deletions events/guildCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,29 @@ const { Event } = require("klasa");
const { MessageEmbed } = require("discord.js");

module.exports = class extends Event {
constructor(...args) {
super(...args, {
enabled: true,
event: "guildCreate"
});
}
constructor(...args) {
super(...args, {
enabled: true,
event: "guildCreate"
});
}

async run(guild) {
if (!guild.available) { return; }
async run(guild) {
if (!guild.available) {
return;
}

const embed = new MessageEmbed()
.setTimestamp()
.setColor(0xF1C40F)
.setTitle(`Greetings to the users of ${guild.name}!`)
.setDescription(`My name is ${this.client.user.username} and I'd like to thank you for inviting me. I am a helpful and fantastic bot created with Klasa, a discord.js framework.\n
If you want so see my awesome commands, feel free to do ${guild.settings.get("prefix")}help. I will send you my help menu where you will be provided with more information.\n
const embed = new MessageEmbed()
.setTimestamp()
.setColor(0xf1c40f)
.setTitle(`Greetings to the users of ${guild.name}!`).setDescription(`My name is ${
this.client.user.username
} and I'd like to thank you for inviting me. I am a helpful and fantastic bot created with Klasa, a discord.js framework.\n
If you want so see my awesome commands, feel free to do ${guild.settings.get(
"prefix"
)}help. I will send you my help menu where you will be provided with more information.\n
If you found something not quite right or have a suggestion, please use my report command and let my creator know! I do have a TOS for some of my abilities so please refer to [this link](https://github.com/Butterstroke/MargarineBot/blob/master/TermsOfService.md) for more information. I look forward to having fun with you!`);

var channel = this.client.util.defaultChannel(guild);
await channel.send({ embed });
}
};

this.client.util.defaultChannel(guild).send({ embed });
}
};
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "margarine",
"version": "1.6.1",
"version": "1.6.2",
"description": "Javascript bot using the Klasa framework",
"main": "index.js",
"private": true,
Expand Down
12 changes: 8 additions & 4 deletions utilities/utilExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ exports.util = {
return guild.channels.cache.get(guild.settings.modlog);
}

let client = guild.client;
let name = ["general", "general-chat", "off-topic"];
let channelID = Array.from(guild.channels.cache).filter(
(channel) => name.includes(channel[1].name) && channel[1].type === "text"
Expand All @@ -82,7 +83,7 @@ exports.util = {
let currChannel = channels[x][1];
if (
currChannel.type === "text" &&
currChannel.permissionsFor(guild.members.cache.get(this.client.user.id)).has("SEND_MESSAGES")
currChannel.permissionsFor(guild.members.cache.get(client.user.id)).has("SEND_MESSAGES")
) {
channelID = currChannel;
x = channels.length;
Expand All @@ -101,8 +102,8 @@ exports.util = {
if (!msg.member.voice.channelID) {
msg.sendLocale("MUSICCHECK_USERNOVC");
return false;
}
}

if (tag !== "join") {
let handler = msg.client.music.get(msg.guild.id);
if (!handler) {
Expand All @@ -126,7 +127,10 @@ exports.util = {
* @return { String }
*/
toTitleCase: (text) => {
return text.split(" ").map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
return text
.split(" ")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
.join(" ");
},
/**
* Generate a Date display for printing
Expand Down

0 comments on commit 32adbee

Please sign in to comment.