From 57863a6ed51ff6bcdb5dd94e24d7b51f4f644dfa Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Tue, 2 Feb 2021 10:51:12 +0530 Subject: [PATCH] update readme examples --- README.md | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6a922c7..d2191f7 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,11 @@ And input your bot's token and Intents. Here is a small example of how to use harmony, ```ts -import { Client, Message, Intents } from 'https://deno.land/x/harmony/mod.ts' +import { + Client, + Message, + GatewayIntents +} from 'https://deno.land/x/harmony/mod.ts' const client = new Client() @@ -58,8 +62,11 @@ client.on('messageCreate', (msg: Message): void => { }) // Connect to gateway -// Replace with your bot's token and intents (Intents.All, Intents.None, Intents.Presence, Intents.GuildMembers) -client.connect('super secret token comes here', Intents.All) +client.connect('super secret token comes here', [ + GatewayIntents.DIRECT_MESSAGES, + GatewayIntents.GUILDS, + GatewayIntents.GUILD_MESSAGES +]) ``` Or with CommandClient! @@ -69,8 +76,7 @@ import { CommandClient, Command, CommandContext, - Message, - Intents + GatewayIntents } from 'https://deno.land/x/harmony/mod.ts' const client = new CommandClient({ @@ -94,19 +100,22 @@ class PingCommand extends Command { client.commands.add(PingCommand) // Connect to gateway -// Replace with your bot's token and intents (Intents.All, Intents.None, Intents.Presence, Intents.GuildMembers) -client.connect('super secret token comes here', Intents.All) +client.connect('super secret token comes here', [ + GatewayIntents.DIRECT_MESSAGES, + GatewayIntents.GUILDS, + GatewayIntents.GUILD_MESSAGES +]) ``` Or with Decorators! ```ts import { - Client, event, - Intents, + CommandClient, command, - CommandContext + CommandContext, + GatewayIntents } from 'https://deno.land/x/harmony/mod.ts' class MyClient extends CommandClient { @@ -128,9 +137,11 @@ class MyClient extends CommandClient { } } -// Connect to gateway -// Replace with your bot's token and intents (Intents.All, Intents.None, Intents.Presence, Intents.GuildMembers) -new MyClient().connect('super secret token comes here', Intents.All) +new MyClient().connect('super secret token comes here', [ + GatewayIntents.DIRECT_MESSAGES, + GatewayIntents.GUILDS, + GatewayIntents.GUILD_MESSAGES +]) ``` ## Docs