nightmare and add some shit
This commit is contained in:
parent
639bbc1126
commit
78c732a002
|
@ -40,4 +40,5 @@
|
|||
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,yarn
|
||||
|
||||
.env
|
||||
node_modules
|
||||
node_modules
|
||||
dist
|
|
@ -20,12 +20,12 @@ RUN apt-get update && \
|
|||
# ------------------------------------ #
|
||||
|
||||
# Enable one of the following depending on whether you use yarn or npm, then remove the other one
|
||||
# COPY --chown=node:node yarn.lock .
|
||||
COPY --chown=node:node yarn.lock .
|
||||
# COPY --chown=node:node package-lock.json .
|
||||
|
||||
# If you use Yarn v3 then enable the following lines:
|
||||
# COPY --chown=node:node .yarnrc.yml .
|
||||
# COPY --chown=node:node .yarn/ .yarn/
|
||||
COPY --chown=node:node .yarnrc.yml .
|
||||
COPY --chown=node:node .yarn/ .yarn/
|
||||
|
||||
# If you have an additional "tsconfig.base.json" file then enable the following line:
|
||||
# COPY --chown=node:node tsconfig.base.json tsconfig.base.json
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,7 +3,7 @@
|
|||
"version": "1.0.0",
|
||||
"main": "dist/index.js",
|
||||
"author": "@sapphire",
|
||||
"license": "UNLICENSE",
|
||||
"license": "LGPL-3.0",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"watch": "tsc -w",
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
import { ApplyOptions } from '@sapphire/decorators';
|
||||
import { Command } from '@sapphire/framework';
|
||||
import { send } from '@sapphire/plugin-editable-commands';
|
||||
import type { Message } from 'discord.js';
|
||||
|
||||
@ApplyOptions<Command.Options>({
|
||||
description: 'ping pong'
|
||||
})
|
||||
export class UserCommand extends Command {
|
||||
public async messageRun(message: Message) {
|
||||
const msg = await send(message, 'Ping?');
|
||||
|
||||
return send(
|
||||
message,
|
||||
`Pong from Docker! Bot Latency ${Math.round(this.container.client.ws.ping)}ms. API Latency ${
|
||||
msg.createdTimestamp - message.createdTimestamp
|
||||
}ms.`
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import { ApplyOptions } from '@sapphire/decorators';
|
||||
import { Command } from '@sapphire/framework';
|
||||
|
||||
@ApplyOptions<Command.Options>({
|
||||
name: 'ping',
|
||||
description: 'A basic slash command'
|
||||
})
|
||||
export class UserCommand extends Command {
|
||||
public override registerApplicationCommands(registry: Command.Registry) {
|
||||
registry.registerChatInputCommand(
|
||||
(builder) => {
|
||||
builder //
|
||||
.setName(this.name)
|
||||
.setDescription(this.description);
|
||||
},
|
||||
{
|
||||
guildIds: ['1030563119132594187']
|
||||
// idHints: []
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
|
||||
return interaction.reply({ content: 'Hello world!' });
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
import { ApplyOptions } from '@sapphire/decorators';
|
||||
import { Command } from '@sapphire/framework';
|
||||
import { ButtonStyle, ComponentType, Message } from 'discord.js';
|
||||
|
||||
@ApplyOptions<Command.Options>({
|
||||
description: 'A basic command'
|
||||
})
|
||||
export class UserCommand extends Command {
|
||||
public async messageRun(message: Message) {
|
||||
await message.channel.send({
|
||||
content: "This button lets you select pronoun roles. You can select multiple.",
|
||||
allowedMentions: {parse: []},
|
||||
components: [{type: ComponentType.ActionRow, components: [
|
||||
{
|
||||
type: ComponentType.Button,
|
||||
style: ButtonStyle.Primary,
|
||||
label: 'Click me!',
|
||||
customId: 'showRolesButton'
|
||||
}
|
||||
]}]
|
||||
});
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ const client = new SapphireClient({
|
|||
regexPrefix: /^(hey +)?bot[,! ]/i,
|
||||
caseInsensitiveCommands: true,
|
||||
logger: {
|
||||
level: LogLevel.Debug
|
||||
level: LogLevel.Info
|
||||
},
|
||||
shards: 'auto',
|
||||
intents: [
|
||||
|
@ -15,11 +15,11 @@ const client = new SapphireClient({
|
|||
GatewayIntentBits.DirectMessages,
|
||||
GatewayIntentBits.GuildModeration,
|
||||
GatewayIntentBits.GuildEmojisAndStickers,
|
||||
GatewayIntentBits.GuildMembers,
|
||||
GatewayIntentBits.GuildMessageReactions,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildVoiceStates,
|
||||
|
||||
GatewayIntentBits.MessageContent
|
||||
],
|
||||
partials: [Partials.Channel],
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
import { ApplyOptions } from '@sapphire/decorators';
|
||||
import { Listener, ListenerOptions } from '@sapphire/framework';
|
||||
import { ButtonStyle, ComponentType, Interaction, InteractionType, MessageComponentInteraction } from 'discord.js';
|
||||
|
||||
@ApplyOptions<ListenerOptions>({
|
||||
event: 'interactionCreate'
|
||||
})
|
||||
export class UserEvent extends Listener {
|
||||
public async run(interaction: Interaction) {
|
||||
if (interaction.type != InteractionType.MessageComponent) return;
|
||||
|
||||
switch (interaction.componentType) {
|
||||
case ComponentType.Button: {
|
||||
if (interaction.customId == 'showRolesButton') await this.showRolesButton(interaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async showRolesButton(interaction: MessageComponentInteraction) {
|
||||
interaction.reply({
|
||||
content: 'This button lets you select pronoun roles. You can select multiple.',
|
||||
allowedMentions: { parse: [] },
|
||||
ephemeral: true,
|
||||
components: [
|
||||
{
|
||||
type: ComponentType.ActionRow,
|
||||
components: [
|
||||
{
|
||||
type: ComponentType.Button,
|
||||
style: ButtonStyle.Danger,
|
||||
label: 'she/her',
|
||||
customId: 'giveRole.<roleId>'
|
||||
},
|
||||
{
|
||||
type: ComponentType.Button,
|
||||
style: ButtonStyle.Success,
|
||||
label: 'he/him',
|
||||
customId: 'giveRole.<roleId>1'
|
||||
},
|
||||
{
|
||||
type: ComponentType.Button,
|
||||
style: ButtonStyle.Success,
|
||||
label: 'they/them',
|
||||
customId: 'giveRole.<roleId>2'
|
||||
},
|
||||
{
|
||||
type: ComponentType.Button,
|
||||
style: ButtonStyle.Success,
|
||||
label: 'ask',
|
||||
customId: 'giveRole.<roleId>3'
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ export class UserEvent extends Listener {
|
|||
public run() {
|
||||
this.printBanner();
|
||||
this.printStoreDebugInformation();
|
||||
this.printMiscInformation();
|
||||
}
|
||||
|
||||
private printBanner() {
|
||||
|
@ -47,4 +48,8 @@ ${line03}${dev ? ` ${pad}${blc('<')}${llc('/')}${blc('>')} ${llc('DEVELOPMENT MO
|
|||
private styleStore(store: Store<any>, last: boolean) {
|
||||
return gray(`${last ? '└─' : '├─'} Loaded ${this.style(store.size.toString().padEnd(3, ' '))} ${store.name}.`);
|
||||
}
|
||||
|
||||
private printMiscInformation() {
|
||||
console.log("Ready!")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue