Initial commit

This commit is contained in:
2024-08-09 16:56:18 +00:00
commit af7628aaf1
22 changed files with 1334 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules/
.env

6
Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM node:22.4-slim
WORKDIR /work
COPY ./package.json ./package-lock.json .
RUN npm install
COPY ./ .
CMD ["npx", "ts-node", "index.ts"]

6
README.md Normal file
View File

@@ -0,0 +1,6 @@
# Algo Discord Bot
## Usage
1. Setup the environment variables in `.env`
2. `docker compose up -d`

23
classes/command.ts Normal file
View File

@@ -0,0 +1,23 @@
import {
SlashCommandBuilder,
SlashCommandSubcommandsOnlyBuilder,
CommandInteraction
} from 'discord.js';
export interface Component{
execute(interaction: unknown): Promise<void>;
build(): unknown;
};
export abstract class Command implements Component{
abstract get name(): string;
abstract get description(): string;
abstract execute(interaction: CommandInteraction): Promise<void>;
build():
SlashCommandBuilder | SlashCommandSubcommandsOnlyBuilder |
Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">{
return new SlashCommandBuilder()
.setName(this.name)
.setDescription(this.description);
}
};

22
classes/extendedclient.ts Normal file
View File

@@ -0,0 +1,22 @@
import {
Client,
Collection,
ClientOptions,
} from 'discord.js';
import {Command} from './command'
export function isExtendedClient(client: Client): client is ExtendedClient{
return (client as ExtendedClient).commands !== undefined;
}
export class ExtendedClient extends Client{
public commands: Collection<string, Command>;
constructor(
opts: ClientOptions,
cmds = new Collection<string, Command>()
){
super(opts);
this.commands = cmds;
}
};

View File

@@ -0,0 +1,78 @@
import discord, {
CommandInteraction,
CommandInteractionOptionResolver,
SlashCommandBuilder,
SlashCommandRoleOption,
SlashCommandStringOption,
InteractionResponse,
Role, APIRole
} from 'discord.js';
import {Command} from '../../classes/command';
import {logger} from '../../logger';
type CIOR = CommandInteractionOptionResolver;
function isRole(role: Role | APIRole): role is Role {
return role['id'] !== null;
}
class Autorole extends Command{
get name(){return "applyrole";}
get description(){return "Apply roles to every member. (Note. up to 1000 members)";}
async execute(interaction: CommandInteraction): Promise<void>{
try{
let role = (interaction.options as CIOR).getRole('role');
if(!role || !isRole(role))
throw Error('role not exist');
if(!interaction.guild || !interaction.guild.id || !interaction.guild.name)
throw Error('guild not exist');
await interaction.reply('Start applying.');
let counter: number = 0;
const memberList = await interaction.guild.members.fetch();
logger.debug('fetch done');
await memberList.each(async member => {
if (!role)
throw Error('role not exist');
if (!interaction.guild)
throw Error('guild not exist');
console.log(`${role.id}, ${member}`);
await interaction.guild.members.addRole({
role: role.id,
user: member,
});
logger.log(`role ${role} has been added to ${member}.`);
counter += 1;
if (counter % 10 === 0)
await interaction.editReply(`${counter} applied.`);
});
await interaction.editReply(`All ${counter} applied.`);
logger.log(`All ${counter} applied.`);
}catch(err: unknown){
let message;
if(err instanceof Error) message = err.message;
else message = String(message);
logger.error(`While executing "/applyrole", ${message}`);
await interaction.reply({content: `While executing "/applyrole", ${message}`});
}
}
override build(): SlashCommandBuilder |
Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">{
return new SlashCommandBuilder()
.setName(this.name)
.setDescription(this.description)
.addRoleOption((option: SlashCommandRoleOption) => option
.setName('role')
.setDescription('The role given.')
.setRequired(true)
)
}
};
export const command = new Autorole();

19
commands/utils/ping.ts Normal file
View File

@@ -0,0 +1,19 @@
import {CommandInteraction} from 'discord.js';
import {Command} from '../../classes/command';
class Ping extends Command{
get name(){return "ping";}
get description(){return "Reply with the RTT of this bot.";}
async execute(interaction: CommandInteraction): Promise<void>{
const sent = await interaction.reply({
content: "Pinging...",
ephemeral: true,
fetchReply: true,
});
await interaction.editReply(`Roundtrip latency: ${
sent.createdTimestamp - interaction.createdTimestamp
}ms`);
}
};
export const command = new Ping();

22
config.ts Normal file
View File

@@ -0,0 +1,22 @@
import dotenv from 'dotenv';
dotenv.config();
export const config = {
token: process.env.DC_TOKEN!,
clientId: process.env.DC_CLIENTID!,
adminId: process.env.ADMIN_ID ?? '',
nickname: '橘ありす',
playing: 'アイドルマスター シンデレラガールズ U149',
defaultRole: process.env.DEFAULT_ROLE ?? '',
urls: {
author: 'https://konchin.com',
icon: 'https://secure.gravatar.com/avatar/c35f2cb664f366e3e3365b9c22216834?d=identicon&s=512',
help: '',
git: 'https://git.konchin.com/discord-bot/Tanikaze-Amane',
issue: 'https://git.konchin.com/discord-bot/Tanikaze-Amane/issues'
},
logger: {
logFile: 'test.log',
},
};

4
docker-compose.yml Normal file
View File

@@ -0,0 +1,4 @@
services:
service:
build: .
restart: always

31
events/handle-commands.ts Normal file
View File

@@ -0,0 +1,31 @@
import {Interaction} from 'discord.js';
import {isExtendedClient} from '../classes/extendedclient';
import {logger} from '../logger';
export async function handleCommands(interaction: Interaction): Promise<void>{
if(!interaction.isChatInputCommand()) return;
if(interaction.commandName === null)
throw logger.error('interaction.commandName not exist');
if(!isExtendedClient(interaction.client))
throw logger.error(`Type Error in function "handleCommands"`);
const command = interaction.client.commands.get(interaction.commandName);
if(!command)
throw logger.error(`No command matching ${interaction.commandName} was found.`);
try{
if('execute' in command)
await command.execute(interaction);
else{
logger.error(`The command (${interaction.commandName}) is missing a require "execute" function`);
return;
}
}catch(err: unknown){
if(interaction.replied || interaction.deferred)
await interaction.followUp({content: 'There was an error while executing this command!', ephemeral: true});
else
await interaction.reply({content: 'There was an error while executing this command!', ephemeral: true});
throw logger.error(`While handling "${interaction.commandName}, ${err}"`);
}
}

View File

@@ -0,0 +1,35 @@
import discord, {
GuildMember, PartialGuildMember
} from 'discord.js';
import {logger} from '../logger';
import {config} from '../config';
function isMember(
member: GuildMember | PartialGuildMember
): member is GuildMember {
return member.partial === false;
}
export async function handleMemberAdd(
member: GuildMember
): Promise<void>{
try{
if(config.clientId === member.id) return;
if(member.partial)
member = await member.fetch();
if(!isMember(member))
throw Error('type mismatch: member.partial');
await member.guild.members.addRole({
role: config.defaultRole,
user: member
});
logger.log(`${member} has been given role.`);
}catch(err: unknown){
let message;
if(err instanceof Error) message = err.message;
else message = String(message);
logger.error(`While executing "handle-autorole", ${message}`);
}
}

View File

@@ -0,0 +1,3 @@
export function reactPreprocess(str: string){
return str.toLowerCase().replaceAll(' ', '');
}

87
index.ts Normal file
View File

@@ -0,0 +1,87 @@
import {Events, GatewayIntentBits, Partials, ActivityType} from 'discord.js';
// Global config
import {config} from './config';
// Classes
import {ExtendedClient} from './classes/extendedclient'
// Initialization functions
import {setNickname} from './init/set-nickname';
import {loadCommands} from './init/load-commands';
import {registerCommands} from './init/register-commands';
import {sendReadyDM} from './init/ready-dm';
// Event-handling functions
import {handleCommands} from './events/handle-commands';
import {handleMemberAdd} from './events/handle-member-add';
// Sub-services
import {logger} from './logger';
const client = new ExtendedClient({
intents:[
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildModeration,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildScheduledEvents,
GatewayIntentBits.AutoModerationConfiguration,
GatewayIntentBits.AutoModerationExecution,
],
partials:[
Partials.User,
Partials.Channel,
Partials.GuildMember,
Partials.Message,
Partials.Reaction,
Partials.GuildScheduledEvent,
Partials.ThreadMember,
]
});
client.login(config.token);
// Event handling
client.on(Events.InteractionCreate, handleCommands);
client.on(Events.GuildMemberAdd, handleMemberAdd);
// Initialization
client.once(Events.ClientReady, async c => {
logger.info(`Logged in as ${c.user.tag}`);
if(client.user){
client.user.setPresence({
activities: [{
name: config.playing,
type: ActivityType.Playing,
}],
status: 'online'
});
logger.info('Set status done');
}
await setNickname(client);
logger.info(`Set nickname as ${config.nickname}`);
const commands = await loadCommands(client);
logger.info(`${commands.length} commands loaded.`);
const regCmdCnt = await registerCommands(commands);
logger.info(`${regCmdCnt} commands registered.`);
logger.info(`Ready!`);
await sendReadyDM(client, config.adminId);
});

25
init/load-commands.ts Normal file
View File

@@ -0,0 +1,25 @@
import path from 'path';
import {readdirSync} from 'fs';
import {ExtendedClient} from '../classes/extendedclient';
import {logger} from '../logger';
export async function loadCommands(client: ExtendedClient): Promise<Array<string>>{
const foldersPath = path.join(__dirname, '../commands');
const commandFolders = readdirSync(foldersPath);
const commands: Array<string> = [];
for(const folder of commandFolders){
const commandsPath = path.join(foldersPath, folder);
const commandsFiles = readdirSync(commandsPath).filter(file => file.endsWith('.ts'));
for(const file of commandsFiles){
const filePath = path.join(commandsPath, file);
const data = await import(filePath);
if(data.command !== undefined){
client.commands.set(data.command.name, data.command);
commands.push(data.command.build().toJSON());
}else
logger.warning(`The command at ${filePath} is missing required properties.`);
}
}
return commands;
}

11
init/ready-dm.ts Normal file
View File

@@ -0,0 +1,11 @@
import {logger} from '../logger';
import {ExtendedClient} from '../classes/extendedclient';
export async function sendReadyDM(client: ExtendedClient, adminId: string): Promise<void>{
try{
await (await client.users.fetch(adminId)).send(`service up at ${new Date()}`);
logger.log('Service up message sent');
}catch(err: unknown){
logger.warning('sendReadyDM failed.');
}
}

26
init/register-commands.ts Normal file
View File

@@ -0,0 +1,26 @@
import {REST, Routes} from 'discord.js';
import {config} from '../config';
import {logger} from '../logger';
function isArray<T>(data: unknown): data is Array<T>{
return (data as Array<T>).length !== undefined;
}
export async function registerCommands(commands: Array<string>): Promise<number>{
const rest = new REST().setToken(config.token);
try{
const data = await rest.put(
Routes.applicationCommands(config.clientId),
{body: commands},
);
if(!isArray(data)) throw Error('Type error');
return data.length;
}catch(err: unknown){
let message;
if(err instanceof Error) message = err.message;
else message = String(message);
logger.error(`While executing "registerCommands", ${message}`);
return -1;
}
}

22
init/set-nickname.ts Normal file
View File

@@ -0,0 +1,22 @@
import {Guild} from 'discord.js';
import {ExtendedClient} from '../classes/extendedclient';
import {config} from '../config';
import {logger} from '../logger';
export async function setNickname(client: ExtendedClient): Promise<void>{
await client.guilds.cache.forEach(async (guild: Guild): Promise<void> => {
try{
// console.log(guild.members);
const self = await guild.members.fetch({user: config.clientId, force: true});
if(!self) throw Error('self not exist');
await self.setNickname(config.nickname);
logger.log(`Nickname had changed in guild: ${guild.name}`);
}catch(err: unknown){
let message;
if(err instanceof Error) message = err.message;
else message = String(message);
logger.error(`While executing setNickname, ${message}`);
}
});
}

45
logger.ts Normal file
View File

@@ -0,0 +1,45 @@
import {appendFileSync} from 'fs';
import moment from 'moment-timezone';
import {config} from './config';
enum LogLevel{
ERROR = 'ERROR',
WARNING = 'WARNING',
DEBUG = 'DEBUG',
LOG = 'LOG',
INFO = 'INFO',
}
class Logger{
constructor(readonly logFile?: string){
this.debug('logger initialized');
}
private currentTime(): string{
return '[' + moment().tz('Asia/Taipei').format('YYYY/MM/DD hh:mm:ss') + ']';
}
private writeLog(content: string, logLevel: LogLevel): void{
const line = `${this.currentTime()} ${logLevel}: ${content}`;
console.log(line);
if(this.logFile !== undefined){
appendFileSync(this.logFile, line + '\n');
}
}
error(content: string): Error{
this.writeLog(content, LogLevel.ERROR); return Error(content);
}
warning(content: string): string{
this.writeLog(content, LogLevel.WARNING); return content;
}
debug(content: string): string{
this.writeLog(content, LogLevel.DEBUG); return content;
}
log(content: string): string{
this.writeLog(content, LogLevel.LOG); return content;
}
info(content: string): string{
this.writeLog(content, LogLevel.INFO); return content;
}
}
export const logger = new Logger(`./${config.logger.logFile}`);

447
package-lock.json generated Normal file
View File

@@ -0,0 +1,447 @@
{
"name": "tanikaze-amane",
"version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "tanikaze-amane",
"version": "1.0.1",
"license": "ISC",
"dependencies": {
"@types/node": "^20.3.2",
"axios": "^1.6.2",
"discord.js": "^14.11.0",
"dotenv": "^16.3.1",
"fs": "^0.0.1-security",
"moment-timezone": "^0.5.43",
"path": "^0.12.7",
"typescript": "^5.1.3"
}
},
"node_modules/@discordjs/builders": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.7.0.tgz",
"integrity": "sha512-GDtbKMkg433cOZur8Dv6c25EHxduNIBsxeHrsRoIM8+AwmEZ8r0tEpckx/sHwTLwQPOF3e2JWloZh9ofCaMfAw==",
"dependencies": {
"@discordjs/formatters": "^0.3.3",
"@discordjs/util": "^1.0.2",
"@sapphire/shapeshift": "^3.9.3",
"discord-api-types": "0.37.61",
"fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.3",
"tslib": "^2.6.2"
},
"engines": {
"node": ">=16.11.0"
}
},
"node_modules/@discordjs/collection": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.3.tgz",
"integrity": "sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==",
"engines": {
"node": ">=16.11.0"
}
},
"node_modules/@discordjs/formatters": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.3.3.tgz",
"integrity": "sha512-wTcI1Q5cps1eSGhl6+6AzzZkBBlVrBdc9IUhJbijRgVjCNIIIZPgqnUj3ntFODsHrdbGU8BEG9XmDQmgEEYn3w==",
"dependencies": {
"discord-api-types": "0.37.61"
},
"engines": {
"node": ">=16.11.0"
}
},
"node_modules/@discordjs/rest": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.1.0.tgz",
"integrity": "sha512-5gFWFkZX2JCFSRzs8ltx8bWmyVi0wPMk6pBa9KGIQSDPMmrP+uOrZ9j9HOwvmVWGe+LmZ5Bov0jMnQd6/jVReg==",
"dependencies": {
"@discordjs/collection": "^2.0.0",
"@discordjs/util": "^1.0.2",
"@sapphire/async-queue": "^1.5.0",
"@sapphire/snowflake": "^3.5.1",
"@vladfrangu/async_event_emitter": "^2.2.2",
"discord-api-types": "0.37.61",
"magic-bytes.js": "^1.5.0",
"tslib": "^2.6.2",
"undici": "5.27.2"
},
"engines": {
"node": ">=16.11.0"
}
},
"node_modules/@discordjs/rest/node_modules/@discordjs/collection": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz",
"integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==",
"engines": {
"node": ">=18"
}
},
"node_modules/@discordjs/util": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.0.2.tgz",
"integrity": "sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw==",
"engines": {
"node": ">=16.11.0"
}
},
"node_modules/@discordjs/ws": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.0.2.tgz",
"integrity": "sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q==",
"dependencies": {
"@discordjs/collection": "^2.0.0",
"@discordjs/rest": "^2.1.0",
"@discordjs/util": "^1.0.2",
"@sapphire/async-queue": "^1.5.0",
"@types/ws": "^8.5.9",
"@vladfrangu/async_event_emitter": "^2.2.2",
"discord-api-types": "0.37.61",
"tslib": "^2.6.2",
"ws": "^8.14.2"
},
"engines": {
"node": ">=16.11.0"
}
},
"node_modules/@discordjs/ws/node_modules/@discordjs/collection": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz",
"integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==",
"engines": {
"node": ">=18"
}
},
"node_modules/@fastify/busboy": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz",
"integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==",
"engines": {
"node": ">=14"
}
},
"node_modules/@sapphire/async-queue": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz",
"integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==",
"engines": {
"node": ">=v14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@sapphire/shapeshift": {
"version": "3.9.3",
"resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.3.tgz",
"integrity": "sha512-WzKJSwDYloSkHoBbE8rkRW8UNKJiSRJ/P8NqJ5iVq7U2Yr/kriIBx2hW+wj2Z5e5EnXL1hgYomgaFsdK6b+zqQ==",
"dependencies": {
"fast-deep-equal": "^3.1.3",
"lodash": "^4.17.21"
},
"engines": {
"node": ">=v14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@sapphire/snowflake": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.1.tgz",
"integrity": "sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==",
"engines": {
"node": ">=v14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@types/node": {
"version": "20.9.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz",
"integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==",
"dependencies": {
"undici-types": "~5.26.4"
}
},
"node_modules/@types/ws": {
"version": "8.5.9",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.9.tgz",
"integrity": "sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg==",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@vladfrangu/async_event_emitter": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz",
"integrity": "sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ==",
"engines": {
"node": ">=v14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"node_modules/axios": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
"integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
"dependencies": {
"follow-redirects": "^1.15.0",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/discord-api-types": {
"version": "0.37.61",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.61.tgz",
"integrity": "sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw=="
},
"node_modules/discord.js": {
"version": "14.14.1",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.14.1.tgz",
"integrity": "sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==",
"dependencies": {
"@discordjs/builders": "^1.7.0",
"@discordjs/collection": "1.5.3",
"@discordjs/formatters": "^0.3.3",
"@discordjs/rest": "^2.1.0",
"@discordjs/util": "^1.0.2",
"@discordjs/ws": "^1.0.2",
"@sapphire/snowflake": "3.5.1",
"@types/ws": "8.5.9",
"discord-api-types": "0.37.61",
"fast-deep-equal": "3.1.3",
"lodash.snakecase": "4.1.1",
"tslib": "2.6.2",
"undici": "5.27.2",
"ws": "8.14.2"
},
"engines": {
"node": ">=16.11.0"
}
},
"node_modules/dotenv": {
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/motdotla/dotenv?sponsor=1"
}
},
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
"node_modules/follow-redirects": {
"version": "1.15.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
"integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/fs": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"node_modules/inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/lodash.snakecase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz",
"integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw=="
},
"node_modules/magic-bytes.js": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.5.0.tgz",
"integrity": "sha512-wJkXvutRbNWcc37tt5j1HyOK1nosspdh3dj6LUYYAvF6JYNqs53IfRvK9oEpcwiDA1NdoIi64yAMfdivPeVAyw=="
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/moment": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
"engines": {
"node": "*"
}
},
"node_modules/moment-timezone": {
"version": "0.5.43",
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz",
"integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==",
"dependencies": {
"moment": "^2.29.4"
},
"engines": {
"node": "*"
}
},
"node_modules/path": {
"version": "0.12.7",
"resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
"integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
"dependencies": {
"process": "^0.11.1",
"util": "^0.10.3"
}
},
"node_modules/process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"node_modules/ts-mixer": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz",
"integrity": "sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ=="
},
"node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/typescript": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/undici": {
"version": "5.27.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz",
"integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==",
"dependencies": {
"@fastify/busboy": "^2.0.0"
},
"engines": {
"node": ">=14.0"
}
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
},
"node_modules/util": {
"version": "0.10.4",
"resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
"integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
"dependencies": {
"inherits": "2.0.3"
}
},
"node_modules/ws": {
"version": "8.14.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
"engines": {
"node": ">=10.0.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": ">=5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
}
}
}

30
package.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "tanikaze-amane",
"version": "1.0.1",
"main": "index.ts",
"scripts": {
"test": "ts-node index.ts",
"clean": "rm -f ./*.js ./commands/*/*.js ./classes/**.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/konchinshih/Tanikaze-Amane.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/konchinshih/Tanikaze-Amane/issues"
},
"homepage": "https://github.com/konchinshih/Tanikaze-Amane#readme",
"dependencies": {
"@types/node": "^20.3.2",
"axios": "^1.6.2",
"discord.js": "^14.11.0",
"dotenv": "^16.3.1",
"fs": "^0.0.1-security",
"moment-timezone": "^0.5.43",
"path": "^0.12.7",
"typescript": "^5.1.3"
},
"description": ""
}

281
test.log Normal file
View File

@@ -0,0 +1,281 @@
[2024/08/09 11:49:04] DEBUG: logger initialized
[2024/08/09 11:50:16] DEBUG: logger initialized
[2024/08/09 11:54:01] DEBUG: logger initialized
[2024/08/09 11:54:02] INFO: Logged in as Arisu Tachibana#8938
[2024/08/09 11:54:02] INFO: Set status done
[2024/08/09 11:54:02] INFO: Set nickname as 橘ありす
[2024/08/09 11:55:13] DEBUG: logger initialized
[2024/08/09 11:55:14] INFO: Logged in as Arisu Tachibana#8938
[2024/08/09 11:55:14] INFO: Set status done
[2024/08/09 11:55:14] INFO: Set nickname as 橘ありす
[2024/08/09 11:55:49] DEBUG: logger initialized
[2024/08/09 11:55:51] INFO: Logged in as Arisu Tachibana#8938
[2024/08/09 11:55:51] INFO: Set status done
[2024/08/09 11:55:51] INFO: Set nickname as 橘ありす
[2024/08/09 11:56:44] DEBUG: logger initialized
[2024/08/09 11:56:46] INFO: Logged in as Arisu Tachibana#8938
[2024/08/09 11:56:46] INFO: Set status done
[2024/08/09 11:56:46] INFO: Set nickname as 橘ありす
[2024/08/10 12:00:15] DEBUG: logger initialized
[2024/08/10 12:00:16] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:00:16] INFO: Set status done
[2024/08/10 12:00:16] INFO: Set nickname as 橘ありす
[2024/08/10 12:12:05] DEBUG: logger initialized
[2024/08/10 12:12:06] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:12:06] INFO: Set status done
[2024/08/10 12:12:06] INFO: Set nickname as 橘ありす
[2024/08/10 12:12:24] DEBUG: logger initialized
[2024/08/10 12:12:25] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:12:25] INFO: Set status done
[2024/08/10 12:12:25] INFO: Set nickname as 橘ありす
[2024/08/10 12:13:37] DEBUG: logger initialized
[2024/08/10 12:13:39] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:13:39] INFO: Set status done
[2024/08/10 12:13:39] INFO: Set nickname as 橘ありす
[2024/08/10 12:13:39] INFO: 2 commands loaded.
[2024/08/10 12:13:39] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:13:40] INFO: 2 commands registered.
[2024/08/10 12:13:40] INFO: Ready!
[2024/08/10 12:13:42] LOG: Service up message sent
[2024/08/10 12:19:03] DEBUG: logger initialized
[2024/08/10 12:19:05] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:19:05] INFO: Set status done
[2024/08/10 12:19:05] INFO: Set nickname as 橘ありす
[2024/08/10 12:19:05] INFO: 2 commands loaded.
[2024/08/10 12:19:05] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:19:05] INFO: 2 commands registered.
[2024/08/10 12:19:05] INFO: Ready!
[2024/08/10 12:19:06] LOG: Service up message sent
[2024/08/10 12:23:38] DEBUG: logger initialized
[2024/08/10 12:23:39] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:23:39] INFO: Set status done
[2024/08/10 12:23:39] INFO: Set nickname as 橘ありす
[2024/08/10 12:23:39] INFO: 2 commands loaded.
[2024/08/10 12:23:40] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:23:40] INFO: 2 commands registered.
[2024/08/10 12:23:40] INFO: Ready!
[2024/08/10 12:23:40] LOG: Service up message sent
[2024/08/10 12:26:04] DEBUG: logger initialized
[2024/08/10 12:26:05] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:26:05] INFO: Set status done
[2024/08/10 12:26:05] INFO: Set nickname as 橘ありす
[2024/08/10 12:26:06] INFO: 2 commands loaded.
[2024/08/10 12:26:06] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:26:07] INFO: 2 commands registered.
[2024/08/10 12:26:07] INFO: Ready!
[2024/08/10 12:26:08] LOG: Service up message sent
[2024/08/10 12:27:02] DEBUG: logger initialized
[2024/08/10 12:27:04] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:27:04] INFO: Set status done
[2024/08/10 12:27:04] INFO: Set nickname as 橘ありす
[2024/08/10 12:27:36] DEBUG: logger initialized
[2024/08/10 12:27:37] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:27:37] INFO: Set status done
[2024/08/10 12:27:37] INFO: Set nickname as 橘ありす
[2024/08/10 12:28:50] DEBUG: logger initialized
[2024/08/10 12:28:52] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:28:52] INFO: Set status done
[2024/08/10 12:28:52] INFO: Set nickname as 橘ありす
[2024/08/10 12:28:52] INFO: 2 commands loaded.
[2024/08/10 12:28:53] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:28:53] INFO: 2 commands registered.
[2024/08/10 12:28:53] INFO: Ready!
[2024/08/10 12:28:53] LOG: Service up message sent
[2024/08/10 12:29:59] DEBUG: logger initialized
[2024/08/10 12:30:01] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:30:01] INFO: Set status done
[2024/08/10 12:30:01] INFO: Set nickname as 橘ありす
[2024/08/10 12:30:14] DEBUG: logger initialized
[2024/08/10 12:30:15] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:30:15] INFO: Set status done
[2024/08/10 12:30:15] INFO: Set nickname as 橘ありす
[2024/08/10 12:30:15] INFO: 2 commands loaded.
[2024/08/10 12:30:16] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:30:16] INFO: 2 commands registered.
[2024/08/10 12:30:16] INFO: Ready!
[2024/08/10 12:30:17] LOG: Service up message sent
[2024/08/10 12:31:25] DEBUG: logger initialized
[2024/08/10 12:31:26] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:31:26] INFO: Set status done
[2024/08/10 12:31:26] INFO: Set nickname as 橘ありす
[2024/08/10 12:31:26] INFO: 2 commands loaded.
[2024/08/10 12:31:27] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:31:27] INFO: 2 commands registered.
[2024/08/10 12:31:27] INFO: Ready!
[2024/08/10 12:31:28] LOG: Service up message sent
[2024/08/10 12:32:46] DEBUG: logger initialized
[2024/08/10 12:32:49] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:32:49] INFO: Set status done
[2024/08/10 12:32:49] INFO: Set nickname as 橘ありす
[2024/08/10 12:33:08] DEBUG: logger initialized
[2024/08/10 12:33:09] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:33:09] INFO: Set status done
[2024/08/10 12:33:09] INFO: Set nickname as 橘ありす
[2024/08/10 12:33:10] INFO: 2 commands loaded.
[2024/08/10 12:33:10] INFO: 2 commands registered.
[2024/08/10 12:33:10] INFO: Ready!
[2024/08/10 12:33:10] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:33:11] LOG: Service up message sent
[2024/08/10 12:33:13] DEBUG: fetch done
[2024/08/10 12:36:56] DEBUG: logger initialized
[2024/08/10 12:36:58] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:36:58] INFO: Set status done
[2024/08/10 12:36:58] INFO: Set nickname as 橘ありす
[2024/08/10 12:37:28] DEBUG: logger initialized
[2024/08/10 12:37:29] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:37:29] INFO: Set status done
[2024/08/10 12:37:29] INFO: Set nickname as 橘ありす
[2024/08/10 12:39:51] DEBUG: logger initialized
[2024/08/10 12:39:53] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:39:53] INFO: Set status done
[2024/08/10 12:39:53] INFO: Set nickname as 橘ありす
[2024/08/10 12:39:53] INFO: 2 commands loaded.
[2024/08/10 12:39:53] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:39:53] INFO: 2 commands registered.
[2024/08/10 12:39:53] INFO: Ready!
[2024/08/10 12:39:54] LOG: Service up message sent
[2024/08/10 12:40:00] DEBUG: fetch done
[2024/08/10 12:40:00] LOG: role <@&1271494006790164591> has been added to <@961518876468854834>.
[2024/08/10 12:40:00] LOG: role <@&1271494006790164591> has been added to <@613384625015750676>.
[2024/08/10 12:40:01] LOG: role <@&1271494006790164591> has been added to <@685708318794055730>.
[2024/08/10 12:40:01] LOG: role <@&1271494006790164591> has been added to <@1123677770292142080>.
[2024/08/10 12:40:01] LOG: role <@&1271494006790164591> has been added to <@305681867716165634>.
[2024/08/10 12:40:02] LOG: role <@&1271494006790164591> has been added to <@744459308070338603>.
[2024/08/10 12:40:02] LOG: role <@&1271494006790164591> has been added to <@861179310911389726>.
[2024/08/10 12:40:02] LOG: role <@&1271494006790164591> has been added to <@844995996982181959>.
[2024/08/10 12:40:03] LOG: role <@&1271494006790164591> has been added to <@667264898090401792>.
[2024/08/10 12:40:03] LOG: role <@&1271494006790164591> has been added to <@860338813870800907>.
[2024/08/10 12:40:10] LOG: role <@&1271494006790164591> has been added to <@1142335432655384697>.
[2024/08/10 12:40:11] LOG: role <@&1271494006790164591> has been added to <@858188580051877888>.
[2024/08/10 12:40:11] LOG: role <@&1271494006790164591> has been added to <@934626036312834128>.
[2024/08/10 12:40:11] LOG: role <@&1271494006790164591> has been added to <@787253311127420930>.
[2024/08/10 12:40:12] LOG: role <@&1271494006790164591> has been added to <@615045596893675521>.
[2024/08/10 12:40:12] LOG: role <@&1271494006790164591> has been added to <@938034817864462427>.
[2024/08/10 12:40:12] LOG: role <@&1271494006790164591> has been added to <@428152098698428416>.
[2024/08/10 12:40:13] LOG: role <@&1271494006790164591> has been added to <@734416971973656656>.
[2024/08/10 12:40:13] LOG: role <@&1271494006790164591> has been added to <@675514494125998090>.
[2024/08/10 12:40:14] LOG: role <@&1271494006790164591> has been added to <@729310749939335209>.
[2024/08/10 12:40:21] LOG: role <@&1271494006790164591> has been added to <@592948702981914647>.
[2024/08/10 12:40:21] LOG: role <@&1271494006790164591> has been added to <@935532811945906258>.
[2024/08/10 12:40:22] LOG: role <@&1271494006790164591> has been added to <@1162354199833608302>.
[2024/08/10 12:40:22] LOG: role <@&1271494006790164591> has been added to <@614327666320998403>.
[2024/08/10 12:40:22] LOG: role <@&1271494006790164591> has been added to <@983339185857523762>.
[2024/08/10 12:40:23] LOG: role <@&1271494006790164591> has been added to <@1155696970271293441>.
[2024/08/10 12:40:23] LOG: role <@&1271494006790164591> has been added to <@812244044633079820>.
[2024/08/10 12:40:24] LOG: role <@&1271494006790164591> has been added to <@1016886484478992504>.
[2024/08/10 12:40:24] LOG: role <@&1271494006790164591> has been added to <@721350642735513641>.
[2024/08/10 12:40:24] LOG: role <@&1271494006790164591> has been added to <@1162060416067837985>.
[2024/08/10 12:40:31] LOG: role <@&1271494006790164591> has been added to <@594021767001931788>.
[2024/08/10 12:40:32] LOG: role <@&1271494006790164591> has been added to <@964453712930160651>.
[2024/08/10 12:40:32] LOG: role <@&1271494006790164591> has been added to <@1000749536123297894>.
[2024/08/10 12:40:32] LOG: role <@&1271494006790164591> has been added to <@883268965768503367>.
[2024/08/10 12:40:33] LOG: role <@&1271494006790164591> has been added to <@1009479864258154500>.
[2024/08/10 12:40:33] LOG: role <@&1271494006790164591> has been added to <@569505773420544011>.
[2024/08/10 12:40:33] LOG: role <@&1271494006790164591> has been added to <@847412476562636811>.
[2024/08/10 12:40:34] LOG: role <@&1271494006790164591> has been added to <@485672651365548036>.
[2024/08/10 12:40:34] LOG: role <@&1271494006790164591> has been added to <@1153607738690113588>.
[2024/08/10 12:40:34] LOG: role <@&1271494006790164591> has been added to <@591653977654034453>.
[2024/08/10 12:40:42] LOG: role <@&1271494006790164591> has been added to <@614099250288132306>.
[2024/08/10 12:40:42] LOG: role <@&1271494006790164591> has been added to <@1161697537833574460>.
[2024/08/10 12:40:42] LOG: role <@&1271494006790164591> has been added to <@832091819185668156>.
[2024/08/10 12:40:43] LOG: role <@&1271494006790164591> has been added to <@617615623484080139>.
[2024/08/10 12:40:43] LOG: role <@&1271494006790164591> has been added to <@1074286090892091423>.
[2024/08/10 12:40:43] LOG: role <@&1271494006790164591> has been added to <@375661678706294786>.
[2024/08/10 12:40:44] LOG: role <@&1271494006790164591> has been added to <@401098991422406666>.
[2024/08/10 12:40:44] LOG: role <@&1271494006790164591> has been added to <@674645791448760341>.
[2024/08/10 12:40:44] LOG: role <@&1271494006790164591> has been added to <@657883658258087958>.
[2024/08/10 12:40:45] LOG: role <@&1271494006790164591> has been added to <@1162977191936667668>.
[2024/08/10 12:40:52] LOG: role <@&1271494006790164591> has been added to <@627459280043376689>.
[2024/08/10 12:40:53] LOG: role <@&1271494006790164591> has been added to <@1095704245547831337>.
[2024/08/10 12:40:53] LOG: role <@&1271494006790164591> has been added to <@967945179724124260>.
[2024/08/10 12:40:54] LOG: role <@&1271494006790164591> has been added to <@597740974126530560>.
[2024/08/10 12:40:54] LOG: role <@&1271494006790164591> has been added to <@1161616531030024194>.
[2024/08/10 12:40:54] LOG: role <@&1271494006790164591> has been added to <@987199159100653578>.
[2024/08/10 12:40:55] LOG: role <@&1271494006790164591> has been added to <@662657032624537611>.
[2024/08/10 12:40:55] LOG: role <@&1271494006790164591> has been added to <@672807641457623061>.
[2024/08/10 12:40:55] LOG: role <@&1271494006790164591> has been added to <@956532433346502717>.
[2024/08/10 12:40:56] LOG: role <@&1271494006790164591> has been added to <@1103900931529117748>.
[2024/08/10 12:41:03] LOG: role <@&1271494006790164591> has been added to <@864847443656048680>.
[2024/08/10 12:41:03] LOG: role <@&1271494006790164591> has been added to <@547441899397709844>.
[2024/08/10 12:41:03] LOG: role <@&1271494006790164591> has been added to <@822103759571779594>.
[2024/08/10 12:41:04] LOG: role <@&1271494006790164591> has been added to <@1271472083708416112>.
[2024/08/10 12:41:04] LOG: role <@&1271494006790164591> has been added to <@815994741568962581>.
[2024/08/10 12:41:04] LOG: role <@&1271494006790164591> has been added to <@1143136307422449749>.
[2024/08/10 12:41:05] LOG: role <@&1271494006790164591> has been added to <@680330196192067586>.
[2024/08/10 12:41:05] LOG: role <@&1271494006790164591> has been added to <@782991782182518844>.
[2024/08/10 12:41:06] LOG: role <@&1271494006790164591> has been added to <@900023827961110558>.
[2024/08/10 12:41:06] LOG: role <@&1271494006790164591> has been added to <@411473927676887041>.
[2024/08/10 12:41:13] LOG: role <@&1271494006790164591> has been added to <@615116646562136095>.
[2024/08/10 12:41:14] LOG: role <@&1271494006790164591> has been added to <@845594993128636416>.
[2024/08/10 12:41:14] LOG: role <@&1271494006790164591> has been added to <@1141075118773260340>.
[2024/08/10 12:41:14] LOG: role <@&1271494006790164591> has been added to <@473004875958059018>.
[2024/08/10 12:41:15] LOG: role <@&1271494006790164591> has been added to <@933551818041069638>.
[2024/08/10 12:41:15] LOG: role <@&1271494006790164591> has been added to <@295025346007531522>.
[2024/08/10 12:41:16] LOG: role <@&1271494006790164591> has been added to <@848125268311801877>.
[2024/08/10 12:41:16] LOG: role <@&1271494006790164591> has been added to <@1162533033027571752>.
[2024/08/10 12:41:17] LOG: role <@&1271494006790164591> has been added to <@1003936827893358702>.
[2024/08/10 12:41:17] LOG: role <@&1271494006790164591> has been added to <@1152976646664626266>.
[2024/08/10 12:41:24] LOG: role <@&1271494006790164591> has been added to <@1083284992584593469>.
[2024/08/10 12:41:24] LOG: role <@&1271494006790164591> has been added to <@867001291125555221>.
[2024/08/10 12:41:24] LOG: role <@&1271494006790164591> has been added to <@672459818463658014>.
[2024/08/10 12:41:25] LOG: role <@&1271494006790164591> has been added to <@964439789703163916>.
[2024/08/10 12:41:25] LOG: role <@&1271494006790164591> has been added to <@270547213686407169>.
[2024/08/10 12:41:25] LOG: role <@&1271494006790164591> has been added to <@550916927829180417>.
[2024/08/10 12:41:26] LOG: role <@&1271494006790164591> has been added to <@548476338034442261>.
[2024/08/10 12:41:26] LOG: role <@&1271494006790164591> has been added to <@556450878740234250>.
[2024/08/10 12:41:26] LOG: role <@&1271494006790164591> has been added to <@1161662275967524976>.
[2024/08/10 12:41:26] LOG: role <@&1271494006790164591> has been added to <@795325723674017803>.
[2024/08/10 12:41:34] LOG: role <@&1271494006790164591> has been added to <@1161927840900591638>.
[2024/08/10 12:41:34] LOG: role <@&1271494006790164591> has been added to <@1157346924907741194>.
[2024/08/10 12:41:35] LOG: role <@&1271494006790164591> has been added to <@715891361580187731>.
[2024/08/10 12:41:35] LOG: role <@&1271494006790164591> has been added to <@699924038935511120>.
[2024/08/10 12:41:35] LOG: role <@&1271494006790164591> has been added to <@1159072165518377050>.
[2024/08/10 12:41:36] LOG: role <@&1271494006790164591> has been added to <@865225193893789716>.
[2024/08/10 12:41:36] LOG: role <@&1271494006790164591> has been added to <@413161665207730176>.
[2024/08/10 12:41:36] LOG: role <@&1271494006790164591> has been added to <@679649185959903232>.
[2024/08/10 12:41:37] LOG: role <@&1271494006790164591> has been added to <@897333700969259049>.
[2024/08/10 12:41:37] LOG: role <@&1271494006790164591> has been added to <@772108261948260362>.
[2024/08/10 12:41:44] LOG: role <@&1271494006790164591> has been added to <@1039977173748031578>.
[2024/08/10 12:41:45] LOG: role <@&1271494006790164591> has been added to <@1091674237242187776>.
[2024/08/10 12:41:45] LOG: role <@&1271494006790164591> has been added to <@750335207302758482>.
[2024/08/10 12:41:45] LOG: role <@&1271494006790164591> has been added to <@762206098328780802>.
[2024/08/10 12:41:46] LOG: role <@&1271494006790164591> has been added to <@844790040127078431>.
[2024/08/10 12:41:46] LOG: role <@&1271494006790164591> has been added to <@729348480858062858>.
[2024/08/10 12:41:46] LOG: role <@&1271494006790164591> has been added to <@1080513895489351710>.
[2024/08/10 12:41:47] LOG: role <@&1271494006790164591> has been added to <@1103997067522752564>.
[2024/08/10 12:41:47] LOG: role <@&1271494006790164591> has been added to <@308074302387912707>.
[2024/08/10 12:41:48] LOG: role <@&1271494006790164591> has been added to <@677147761707057182>.
[2024/08/10 12:41:55] LOG: role <@&1271494006790164591> has been added to <@652441757794959402>.
[2024/08/10 12:41:55] LOG: role <@&1271494006790164591> has been added to <@332494471369588736>.
[2024/08/10 12:41:56] LOG: role <@&1271494006790164591> has been added to <@622274233690488840>.
[2024/08/10 12:41:56] LOG: role <@&1271494006790164591> has been added to <@755690094928724008>.
[2024/08/10 12:41:56] LOG: role <@&1271494006790164591> has been added to <@609747782701416479>.
[2024/08/10 12:41:57] LOG: role <@&1271494006790164591> has been added to <@601827725489209374>.
[2024/08/10 12:41:57] LOG: role <@&1271494006790164591> has been added to <@1161649565699686521>.
[2024/08/10 12:41:57] LOG: role <@&1271494006790164591> has been added to <@510634003871825930>.
[2024/08/10 12:41:58] LOG: role <@&1271494006790164591> has been added to <@585441509189615616>.
[2024/08/10 12:41:58] LOG: role <@&1271494006790164591> has been added to <@715198881742323733>.
[2024/08/10 12:42:05] LOG: role <@&1271494006790164591> has been added to <@436538215055360000>.
[2024/08/10 12:42:06] LOG: role <@&1271494006790164591> has been added to <@640380511079890954>.
[2024/08/10 12:42:06] LOG: role <@&1271494006790164591> has been added to <@1174653577701118052>.
[2024/08/10 12:42:06] LOG: role <@&1271494006790164591> has been added to <@501003971985670145>.
[2024/08/10 12:42:07] LOG: role <@&1271494006790164591> has been added to <@698779304405762048>.
[2024/08/10 12:42:07] LOG: role <@&1271494006790164591> has been added to <@1161948635332882452>.
[2024/08/10 12:42:07] LOG: role <@&1271494006790164591> has been added to <@650476569352994827>.
[2024/08/10 12:42:08] LOG: role <@&1271494006790164591> has been added to <@681386813323083834>.
[2024/08/10 12:42:08] LOG: role <@&1271494006790164591> has been added to <@618448650212737046>.
[2024/08/10 12:42:08] LOG: role <@&1271494006790164591> has been added to <@683212307337052161>.
[2024/08/10 12:42:16] LOG: role <@&1271494006790164591> has been added to <@1160909291331526717>.
[2024/08/10 12:42:16] LOG: role <@&1271494006790164591> has been added to <@270846363313504256>.
[2024/08/10 12:42:16] LOG: role <@&1271494006790164591> has been added to <@991356461043175465>.
[2024/08/10 12:42:17] LOG: role <@&1271494006790164591> has been added to <@1163889140723630141>.
[2024/08/10 12:44:44] DEBUG: logger initialized
[2024/08/10 12:44:45] INFO: Logged in as Arisu Tachibana#8938
[2024/08/10 12:44:45] INFO: Set status done
[2024/08/10 12:44:45] INFO: Set nickname as 橘ありす
[2024/08/10 12:44:45] INFO: 2 commands loaded.
[2024/08/10 12:44:46] LOG: Nickname had changed in guild: 515505 Introduction to Algorithms
[2024/08/10 12:44:46] INFO: 2 commands registered.
[2024/08/10 12:44:46] INFO: Ready!
[2024/08/10 12:44:47] LOG: Service up message sent
[2024/08/10 12:46:55] LOG: <@334203095179591684> has been given role.

109
tsconfig.json Normal file
View File

@@ -0,0 +1,109 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2021", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "commonJS", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
// "resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}