Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
LarmuseauNiels committed Apr 29, 2023
2 parents 0f1a612 + c14ee1a commit 8ddc436
Show file tree
Hide file tree
Showing 13 changed files with 781 additions and 34 deletions.
Binary file added achievementIcons/achievement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added achievementIcons/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions events/interactionCreate.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
module.exports = {
name: "interactionCreate",
async execute(interaction) {
console.log("executing interaction");
global.bugsnag.startSession();
global.bugsnag.leaveBreadcrumb(
interaction.commandName ?? "No command name"
);
try {
if (interaction.isButton()) {
console.log(interaction.customId);
let buttonId = interaction.customId.split("_")[0];
let button = global.client.buttons.get(buttonId);
await button.execute(interaction);
if (button) await button.execute(interaction);
}
if (interaction.isMessageContextMenuCommand()) {
console.log(interaction.commandName);
let menu = global.client.contextMenus.get(interaction.commandName);
await menu.execute(interaction);
if (menu) await menu.execute(interaction);
} else if (interaction.isUserContextMenuCommand()) {
console.log(interaction.commandName);
let menu = global.client.contextMenus.get(interaction.commandName);
await menu.execute(interaction);
if (menu) await menu.execute(interaction);
} else {
if (interaction.isCommand()) {
console.log(interaction.commandName);
let command = global.client.commands.get(interaction.commandName);
await command.execute(interaction);
if (command) await command.execute(interaction);
}
}
if (interaction.isModalSubmit()) {
let modalId = interaction.customId.split("_")[0];
let modal = global.client.modals.get(modalId);
await modal.execute(interaction);
if (modal) await modal.execute(interaction);
}
if (interaction.isAutocomplete()) {
let command = global.client.commands.get(interaction.commandName);
await command.autocomplete(interaction);
if (command) await command.autocomplete(interaction);
}
} catch (error) {
global.bugsnag.notify(error);
Expand Down
5 changes: 5 additions & 0 deletions events/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@ module.exports = {
.then((invite) => client.invites.set(guild.id, invite))
.catch((error) => console.log(error));
}
client.user.setActivity({
name: "flamingpalm.com",
type: "WATCHING",
url: "https://flamingpalm.com",
});
},
};
2 changes: 2 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Islander } from "./islander/islander";
import { AchievementsModule } from "./islander/AchievementsModule";
import { WebApi } from "./modules/WebApi";
import Bugsnag from "@bugsnag/js";
import BugsnagPluginExpress from "@bugsnag/plugin-express";

const fs = require("fs");
const {
Expand Down Expand Up @@ -70,6 +71,7 @@ class FpgClient extends Client {

Bugsnag.start({
apiKey: process.env.BUGSNAG_API_KEY,
plugins: [BugsnagPluginExpress],
appVersion: process.env.CAPROVER_GIT_COMMIT_SHA.slice(0, 7),
});
global.bugsnag = Bugsnag;
Expand Down
Loading

0 comments on commit 8ddc436

Please sign in to comment.