123456789101112131415161718192021222324252627282930313233343536 |
- import fs from 'fs';
- import {Client, Intents, MessageActionRow, MessageButton} from 'discord.js';
- import Config from './config.js';
- async function main() {
- const client = new Client({intents: [Intents.FLAGS.GUILDS]});
- client.once('ready', async () => {
- console.log('ready');
- const welcome_channel = client.channels.cache.get(Config.discord_welcome_channel_id);
- await welcome_channel.send({
- content: `**__Rules__**
- - Be nice to others and stay family friendly
- - That's it
- To access text channels, link your account with the button below.`,
- components: [
- new MessageActionRow().addComponents([
- new MessageButton({
- custom_id: 'orl_link_osu_account',
- label: 'Link account',
- style: 'PRIMARY',
- }),
- ]),
- ],
- });
- console.log('sent');
- });
- const {discord_token} = JSON.parse(fs.readFileSync('./config.json'));
- await client.login(discord_token);
- }
- main();
|