deploy_prompts.js 970 B

123456789101112131415161718192021222324252627282930313233343536
  1. import fs from 'fs';
  2. import {Client, Intents, MessageActionRow, MessageButton} from 'discord.js';
  3. import Config from './config.js';
  4. async function main() {
  5. const client = new Client({intents: [Intents.FLAGS.GUILDS]});
  6. client.once('ready', async () => {
  7. console.log('ready');
  8. const welcome_channel = client.channels.cache.get(Config.discord_welcome_channel_id);
  9. await welcome_channel.send({
  10. content: `**__Rules__**
  11. - Be nice to others and stay family friendly
  12. - That's it
  13. To access text channels, link your account with the button below.`,
  14. components: [
  15. new MessageActionRow().addComponents([
  16. new MessageButton({
  17. custom_id: 'orl_link_osu_account',
  18. label: 'Link account',
  19. style: 'PRIMARY',
  20. }),
  21. ]),
  22. ],
  23. });
  24. console.log('sent');
  25. });
  26. const {discord_token} = JSON.parse(fs.readFileSync('./config.json'));
  27. await client.login(discord_token);
  28. }
  29. main();