mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 00:10:58 -05:00
Compare commits
2 Commits
33a37aa6e1
...
90fd9e62ab
Author | SHA1 | Date | |
---|---|---|---|
|
90fd9e62ab | ||
|
31f955a52a |
2
.pnp.loader.mjs
generated
2
.pnp.loader.mjs
generated
@ -1471,7 +1471,7 @@ async function load$1(urlString, context, nextLoad) {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
format,
|
format,
|
||||||
source: await fs.promises.readFile(filePath, `utf8`),
|
source: format === `commonjs` ? void 0 : await fs.promises.readFile(filePath, `utf8`),
|
||||||
shortCircuit: true
|
shortCircuit: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
yarnPath: .yarn/releases/yarn-3.6.2.cjs
|
yarnPath: .yarn/releases/yarn-3.6.3.cjs
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
"node": ">=18.17.0",
|
"node": ">=18.17.0",
|
||||||
"yarn": ">=3.6.1"
|
"yarn": ">=3.6.1"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@3.6.2",
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discord-player/extractor": "4.4.1",
|
"@discord-player/extractor": "4.4.1",
|
||||||
"@discordjs/opus": "0.9.0",
|
"@discordjs/opus": "0.9.0",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import Discord, {Client, WebhookClient, GatewayIntentBits, Partials} from 'discord.js';
|
import Discord, {Client, GatewayIntentBits, Partials} from 'discord.js';
|
||||||
import {readFileSync, readdirSync} from 'node:fs';
|
import {readFileSync, readdirSync} from 'node:fs';
|
||||||
import {formatTimeOpt, Tokens, Config, repeatedMessages, type MPServerCache} from './typings/interfaces';
|
import {formatTimeOpt, Tokens, Config, repeatedMessages, type MPServerCache} from './typings/interfaces';
|
||||||
import bannedWords from './models/bannedWords.js';
|
import bannedWords from './models/bannedWords.js';
|
||||||
@ -212,11 +212,3 @@ export default class TClient extends Client {
|
|||||||
} return array.join(dirSlash);
|
} return array.join(dirSlash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WClient extends WebhookClient {
|
|
||||||
tokens: Tokens;
|
|
||||||
constructor(){
|
|
||||||
super({url: tokens.webhook_url})
|
|
||||||
this.tokens = tokens as Tokens;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -34,8 +34,8 @@ export default {
|
|||||||
if (typeof output === 'object') output = 'js\n'+util.formatWithOptions({depth: 1}, '%O', output)
|
if (typeof output === 'object') output = 'js\n'+util.formatWithOptions({depth: 1}, '%O', output)
|
||||||
else output = '\n' + String(output);
|
else output = '\n' + String(output);
|
||||||
[
|
[
|
||||||
client.tokens.main,client.tokens.beta,client.tokens.toast,client.tokens.webhook_url,
|
client.tokens.main,client.tokens.beta,client.tokens.toast,client.tokens.dontlookatme.client,client.tokens.dontlookatme.secret,
|
||||||
client.tokens.webhook_url_test,client.tokens.mongodb_uri,client.tokens.mongodb_uri_dev,client.tokens.octokit
|
client.tokens.mongodb_uri,client.tokens.mongodb_uri_dev,client.tokens.octokit
|
||||||
].forEach(x=>output = output.replace(new RegExp(x as string,'g'),':noblank: No token?'));
|
].forEach(x=>output = output.replace(new RegExp(x as string,'g'),':noblank: No token?'));
|
||||||
const embed = new client.embed().setColor(client.config.embedColor).setTitle('__Eval__').addFields(
|
const embed = new client.embed().setColor(client.config.embedColor).setTitle('__Eval__').addFields(
|
||||||
{name: 'Input', value: `\`\`\`js\n${code.slice(0,1010)}\n\`\`\``},
|
{name: 'Input', value: `\`\`\`js\n${code.slice(0,1010)}\n\`\`\``},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import Discord from 'discord.js';
|
import Discord from 'discord.js';
|
||||||
import TClient,{WClient} from '../client.js';
|
import TClient from '../client.js';
|
||||||
export default {
|
export default {
|
||||||
async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
|
async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
|
||||||
const replyInDM = interaction.options.getString('message');
|
const replyInDM = interaction.options.getString('message');
|
||||||
@ -12,7 +12,7 @@ export default {
|
|||||||
const dmFail = `Failed to send a DM to <@${userid}>, they possibly have it turned off or blocked me.\nSuggestion ID: **${suggestionIDReply}**`;
|
const dmFail = `Failed to send a DM to <@${userid}>, they possibly have it turned off or blocked me.\nSuggestion ID: **${suggestionIDReply}**`;
|
||||||
({
|
({
|
||||||
your: async()=>{
|
your: async()=>{
|
||||||
const wclient = new WClient;
|
const webhook = await (await (client.channels.fetch(client.config.mainServer.channels.bot_suggestions) as Promise<Discord.TextChannel>)).fetchWebhooks().then(x => x.find(y => y.name === client.user.username));
|
||||||
const suggestionText = interaction.options.getString('suggestion');
|
const suggestionText = interaction.options.getString('suggestion');
|
||||||
const suggestionImage = interaction.options.getAttachment('image');
|
const suggestionImage = interaction.options.getAttachment('image');
|
||||||
const notifEmbed = new client.embed()
|
const notifEmbed = new client.embed()
|
||||||
@ -25,7 +25,7 @@ export default {
|
|||||||
suggestionText
|
suggestionText
|
||||||
].join('\n'));
|
].join('\n'));
|
||||||
if (suggestionImage) notifEmbed.setImage(suggestionImage.url);
|
if (suggestionImage) notifEmbed.setImage(suggestionImage.url);
|
||||||
wclient.send({embeds: [notifEmbed], username: `${client.user.username} Notification`, avatarURL: client.user.avatarURL({size: 256})}
|
webhook.send({embeds: [notifEmbed], username: `${client.user.username} Notification`, avatarURL: client.user.avatarURL({size: 256})}
|
||||||
).catch(e=>{
|
).catch(e=>{
|
||||||
console.log(e.message);
|
console.log(e.message);
|
||||||
interaction.reply({content: 'Failed to send suggestion, try again later.', ephemeral: true})
|
interaction.reply({content: 'Failed to send suggestion, try again later.', ephemeral: true})
|
||||||
|
@ -81,6 +81,7 @@
|
|||||||
"console": "1011318687065710663",
|
"console": "1011318687065710663",
|
||||||
"errors": "1009754872188506192",
|
"errors": "1009754872188506192",
|
||||||
"thismeanswar": "1091300529696673792",
|
"thismeanswar": "1091300529696673792",
|
||||||
|
"bot_suggestions": "1040018521746325586",
|
||||||
"bot_status": "1009753780188884992",
|
"bot_status": "1009753780188884992",
|
||||||
"logs": "548032776830582794",
|
"logs": "548032776830582794",
|
||||||
"welcome": "621134751897616406",
|
"welcome": "621134751897616406",
|
||||||
|
3
src/typings/interfaces.d.ts
vendored
3
src/typings/interfaces.d.ts
vendored
@ -121,8 +121,6 @@ export interface Tokens {
|
|||||||
secret: string
|
secret: string
|
||||||
}
|
}
|
||||||
octokit: string
|
octokit: string
|
||||||
webhook_url: string
|
|
||||||
webhook_url_test: string
|
|
||||||
mongodb_uri: string
|
mongodb_uri: string
|
||||||
mongodb_uri_dev: string
|
mongodb_uri_dev: string
|
||||||
}
|
}
|
||||||
@ -181,6 +179,7 @@ export interface Config {
|
|||||||
console: string,
|
console: string,
|
||||||
errors: string,
|
errors: string,
|
||||||
thismeanswar: string,
|
thismeanswar: string,
|
||||||
|
bot_suggestions: string,
|
||||||
bot_status: string,
|
bot_status: string,
|
||||||
logs: string,
|
logs: string,
|
||||||
welcome: string,
|
welcome: string,
|
||||||
|
Loading…
Reference in New Issue
Block a user