mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
ci(Testing): add TypeScript test job (#4002)
* ci(Testing): add TypeScript job * chore: add eol before eof
This commit is contained in:
28
typings/index.ts
Normal file
28
typings/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference path="index.d.ts" />
|
||||
|
||||
import { Client } from 'discord.js';
|
||||
|
||||
const client: Client = new Client();
|
||||
|
||||
client.on('ready', () => {
|
||||
console.log(`Client is logged in as ${client.user!.tag} and ready!`);
|
||||
});
|
||||
|
||||
client.on('guildCreate', g => {
|
||||
const channel = g.channels.cache.random();
|
||||
if (!channel) return;
|
||||
|
||||
channel.setName('foo').then(updatedChannel => {
|
||||
console.log(`New channel name: ${updatedChannel.name}`);
|
||||
});
|
||||
});
|
||||
|
||||
client.on('messageReactionRemoveAll', async message => {
|
||||
console.log(`messageReactionRemoveAll - id: ${message.id} (${message.id.length})`);
|
||||
|
||||
if (message.partial) message = await message.fetch();
|
||||
|
||||
console.log(`messageReactionRemoveAll - content: ${message.content}`);
|
||||
});
|
||||
|
||||
client.login('absolutely-valid-token');
|
||||
Reference in New Issue
Block a user