generated from Baipyrus/DiscordJS-Template
Compare commits
No commits in common. "3b1d64061298b85dafc1027182cb576741f02b36" and "09f9280ae1ab3c360ed9f5accf67faeb42677009" have entirely different histories.
3b1d640612
...
09f9280ae1
@ -249,8 +249,7 @@ Registered roles will automatically be assigned to new members
|
|||||||
|
|
||||||
## Quirks/Bugs
|
## Quirks/Bugs
|
||||||
|
|
||||||
- Custom VC not working in global space
|
None
|
||||||
- Categories with Custom VC channel in them need explicit permissions
|
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
ChannelType,
|
ChannelType,
|
||||||
GuildChannel,
|
|
||||||
PermissionFlagsBits,
|
PermissionFlagsBits,
|
||||||
SlashCommandBuilder,
|
SlashCommandBuilder,
|
||||||
ChatInputCommandInteraction
|
ChatInputCommandInteraction
|
||||||
@ -91,7 +90,6 @@ export async function execute(interaction) {
|
|||||||
}
|
}
|
||||||
case 'register': {
|
case 'register': {
|
||||||
// Get channel id from user input
|
// Get channel id from user input
|
||||||
/** @type {GuildChannel} */
|
|
||||||
const { id } = options.getChannel('channel');
|
const { id } = options.getChannel('channel');
|
||||||
|
|
||||||
step = 'save';
|
step = 'save';
|
||||||
|
@ -6,7 +6,7 @@ export const name = Events.MessageCreate;
|
|||||||
/** @param {Message} message */
|
/** @param {Message} message */
|
||||||
export async function execute(message) {
|
export async function execute(message) {
|
||||||
// Ignore direct messages and own messages
|
// Ignore direct messages and own messages
|
||||||
if (!message.inGuild() || message.author.id === message.client.user.id) return;
|
if (!message.inGuild() || message.author.id === process.env.CLIENT) return;
|
||||||
|
|
||||||
// Split message content into words
|
// Split message content into words
|
||||||
const words = message.content
|
const words = message.content
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import { Events, MessageReaction, User } from 'discord.js';
|
import { Events, MessageReaction, User } from 'discord.js';
|
||||||
import { Messages, RoleEmojiPairs } from '../../database.js';
|
import { Messages, RoleEmojiPairs } from '../../database.js';
|
||||||
|
import { config } from 'dotenv';
|
||||||
|
|
||||||
|
config();
|
||||||
|
|
||||||
export const name = Events.MessageReactionAdd;
|
export const name = Events.MessageReactionAdd;
|
||||||
/**
|
/**
|
||||||
@ -7,7 +10,7 @@ export const name = Events.MessageReactionAdd;
|
|||||||
* @param {User} user
|
* @param {User} user
|
||||||
*/
|
*/
|
||||||
export async function execute(reaction, user) {
|
export async function execute(reaction, user) {
|
||||||
if (user.id === user.client.user.id) return;
|
if (user.id === process.env.CLIENT) return;
|
||||||
|
|
||||||
// Get message
|
// Get message
|
||||||
const msgID = reaction.message.id;
|
const msgID = reaction.message.id;
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import { Events, MessageReaction, User } from 'discord.js';
|
import { Events, MessageReaction, User } from 'discord.js';
|
||||||
import { Messages, RoleEmojiPairs } from '../../database.js';
|
import { Messages, RoleEmojiPairs } from '../../database.js';
|
||||||
|
import { config } from 'dotenv';
|
||||||
|
|
||||||
|
config();
|
||||||
|
|
||||||
export const name = Events.MessageReactionRemove;
|
export const name = Events.MessageReactionRemove;
|
||||||
/**
|
/**
|
||||||
@ -7,7 +10,7 @@ export const name = Events.MessageReactionRemove;
|
|||||||
* @param {User} user
|
* @param {User} user
|
||||||
*/
|
*/
|
||||||
export async function execute(reaction, user) {
|
export async function execute(reaction, user) {
|
||||||
if (user.id === user.client.user.id) return;
|
if (user.id === process.env.CLIENT) return;
|
||||||
|
|
||||||
// Get message
|
// Get message
|
||||||
const msgID = reaction.message.id;
|
const msgID = reaction.message.id;
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
import { ChatInputCommandInteraction, ContextMenuCommandInteraction, Role } from 'discord.js';
|
import { ChatInputCommandInteraction, ContextMenuCommandInteraction, Role } from 'discord.js';
|
||||||
import { Messages, RoleEmojiPairs, Guilds } from './database.js';
|
import { Messages, RoleEmojiPairs, Guilds } from './database.js';
|
||||||
import { readdir } from 'fs/promises';
|
import { readdir } from 'fs/promises';
|
||||||
|
import { config } from 'dotenv';
|
||||||
import { Op } from 'sequelize';
|
import { Op } from 'sequelize';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import Module from 'module';
|
import Module from 'module';
|
||||||
|
|
||||||
|
config();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main logic of the different 'Self Roles remove' commands to remove the functionality from a `Message`.
|
* Main logic of the different 'Self Roles remove' commands to remove the functionality from a `Message`.
|
||||||
* @param {(ChatInputCommandInteraction|ContextMenuCommandInteraction)} interaction The interaction related to this command.
|
* @param {(ChatInputCommandInteraction|ContextMenuCommandInteraction)} interaction The interaction related to this command.
|
||||||
@ -87,7 +90,7 @@ const saveMessageData = async (id, role, emoji) => {
|
|||||||
* @param {string} emoji Either a unicode emoji or a string representation in Discord custom emoji format.
|
* @param {string} emoji Either a unicode emoji or a string representation in Discord custom emoji format.
|
||||||
*/
|
*/
|
||||||
const editMessage = async (message, role, emoji) => {
|
const editMessage = async (message, role, emoji) => {
|
||||||
if (message.author.id !== message.client.user.id) return;
|
if (message.author.id !== process.env.CLIENT) return;
|
||||||
|
|
||||||
// Find out whether to pad message or already present
|
// Find out whether to pad message or already present
|
||||||
let padding = '\n';
|
let padding = '\n';
|
||||||
|
Loading…
Reference in New Issue
Block a user