-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5476a9d
commit f41e8a2
Showing
62 changed files
with
1,451 additions
and
2,068 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.env | ||
temp/ | ||
run.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
language = "nodejs" | ||
run = "node ." | ||
language = "deno" | ||
run = "deno run --import-map=imports.json --allow-net --allow-env --allow-read index.ts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.lint": true, | ||
"deno.unstable": true, | ||
"deno.importMap": "./imports.json", | ||
"deno.config": "./tsconfig.json", | ||
"deno.suggest.imports.hosts": { | ||
"https://deno.land": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,2 @@ | ||
# BIDOME | ||
BIDOME BOT - Report bugs or suggest a feature here. | ||
--- | ||
Use the issue tab to report bugs or suggest features | ||
To contribute to the bot: | ||
|
||
| Command | Directory | | ||
| --- | --- | | ||
| Statuses | Status.js | | ||
| MhMeme | Assets/memes/mhmemes.txt | | ||
|
||
# Bidome Bot | ||
Info coming soon! |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"eightball": { | ||
"responses": [ | ||
"It is Certain.", | ||
"It is decidedly so.", | ||
"Without a doubt.", | ||
"Yes definitely.", | ||
"You may rely on it.", | ||
"As I see it, yes.", | ||
"Most likely.", | ||
"Outlook good.", | ||
"Yes.", | ||
"Signs point to yes.", | ||
"Reply hazy, try again.", | ||
"Ask again later.", | ||
"Better not tell you now.", | ||
"Cannot predict now.", | ||
"Concentrate and ask again.", | ||
"Don't count on it.", | ||
"My reply is no.", | ||
"My sources say no.", | ||
"Outlook not so good.", | ||
"Very doubtful." | ||
] | ||
}, | ||
"dice": { | ||
"firstrow": [ | ||
4, | ||
6, | ||
8, | ||
10, | ||
12 | ||
], | ||
"secondrow": [ | ||
20 | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { Command, CommandContext, Embed } from 'harmony'; | ||
|
||
export class command extends Command { | ||
name = 'eval'; | ||
ownerOnly = true; | ||
category = 'dev'; | ||
aliases = ['execute']; | ||
description = 'Execute code'; | ||
usage = 'Eval <code>'; | ||
async execute(ctx: CommandContext) { | ||
let code = ctx.argString ?? ''; | ||
if (code.startsWith("```ts") || code.startsWith(" ```ts")) { | ||
code = code.substring(code.split("\n")[0].length, code.length - 3); | ||
} | ||
const message = await ctx.message.reply(undefined, { | ||
embed: new Embed({ | ||
author: { | ||
name: 'Bidome bot', | ||
icon_url: ctx.message.client.user?.avatarURL(), | ||
}, | ||
description: 'Executing code!', | ||
}).setColor('random'), | ||
}); | ||
try { | ||
const executed = await eval(code); | ||
console.log( | ||
'Output from command ' + code + ', ', | ||
executed ?? 'No output!' | ||
); | ||
await message.edit( | ||
new Embed({ | ||
author: { | ||
name: 'Bidome bot', | ||
icon_url: ctx.message.client.user?.avatarURL(), | ||
}, | ||
title: 'Executed code', | ||
description: 'Please check console for an output!', | ||
}).setColor('random') | ||
); | ||
} catch (e: unknown) { | ||
console.log( | ||
'An error occured while executing the eval command ' + | ||
code + | ||
'! Error: ', | ||
e | ||
); | ||
await message.edit( | ||
new Embed({ | ||
author: { | ||
name: 'Bidome bot', | ||
icon_url: ctx.message.client.user?.avatarURL(), | ||
}, | ||
title: 'Error occured while executing!', | ||
description: 'Please check console for an error!', | ||
}).setColor('random') | ||
); | ||
return; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { | ||
Command, | ||
CommandContext, | ||
Embed, | ||
isMessageComponentInteraction, | ||
} from 'harmony'; | ||
import { format } from 'tools'; | ||
|
||
export class command extends Command { | ||
name = 'setpresence'; | ||
ownerOnly = true; | ||
category = 'dev'; | ||
description = "Change the bot's presence"; | ||
usage = 'Setpresence'; | ||
async execute(ctx: CommandContext) { | ||
const now = Date.now(); | ||
const message = await ctx.message.reply(undefined, { | ||
embed: new Embed({ | ||
author: { | ||
name: 'Bidome bot', | ||
icon_url: ctx.message.client.user?.avatarURL(), | ||
}, | ||
title: 'Bot status', | ||
description: 'Please select the status type!', | ||
footer: { | ||
text: 'This will time out in 30 seconds!', | ||
}, | ||
}).setColor('random'), | ||
components: [ | ||
{ | ||
type: 1, | ||
components: ['dnd', 'idle', 'online', 'invisible'].map( | ||
(status) => ({ | ||
type: 2, | ||
label: format(status), | ||
style: 'BLURPLE', | ||
customID: `${status.toLowerCase()}-${now}`, | ||
}) | ||
), | ||
}, | ||
], | ||
}); | ||
|
||
const choice = await ctx.client.waitFor( | ||
'interactionCreate', | ||
(i) => | ||
isMessageComponentInteraction(i) && | ||
i.customID.endsWith(`-${now}`) && | ||
i.user.id === ctx.author.id, | ||
30 * 1000 | ||
); | ||
if (!choice[0]) { | ||
await message.edit(undefined, { | ||
embed: new Embed({ | ||
author: { | ||
name: 'Bidome bot', | ||
icon_url: ctx.message.client.user?.avatarURL(), | ||
}, | ||
title: 'Bot status', | ||
description: 'Presence change timed out!', | ||
}).setColor('random'), | ||
components: [], | ||
}); | ||
return; | ||
} else { | ||
if (!isMessageComponentInteraction(choice[0])) return; | ||
const type = choice[0].customID.split('-')[0].toUpperCase() as | ||
| 'dnd' | ||
| 'idle' | ||
| 'online' | ||
| 'invisible'; | ||
ctx.client.setPresence({ | ||
status: type, | ||
}); | ||
await message.edit(undefined, { | ||
embed: new Embed({ | ||
author: { | ||
name: 'Bidome bot', | ||
icon_url: ctx.message.client.user?.avatarURL(), | ||
}, | ||
title: 'Bot status', | ||
description: 'Presence has been changed!', | ||
}).setColor('random'), | ||
components: [], | ||
}); | ||
} | ||
} | ||
} |
Oops, something went wrong.