No description
Find a file
2020-12-02 10:00:14 +05:30
.github/workflows remove os matrix 2020-11-30 20:15:06 +09:00
.vscode feat(almost-everything): a lot of things 2020-11-28 10:44:37 +05:30
examples Change names and format codes 2020-11-08 16:58:24 +09:00
src try not to use unknown 2020-11-30 20:11:49 +09:00
.eslintrc.js Now we can listen and send event 2020-10-26 02:03:53 +09:00
.gitignore Fix some lint errors and make more runtime errors(for now) 2020-11-02 15:58:23 +09:00
banner.png Add files via upload 2020-11-08 16:57:35 +09:00
CONTRIBUTING.md Update CONTRIBUTING.md 2020-11-06 16:39:03 +09:00
LICENSE feat(LICENSE) 2020-12-02 10:42:42 +09:00
mod.ts feat(integrations|application): implementation 2020-11-25 18:11:51 +05:30
package.json Update package.json 2020-11-28 12:55:46 +09:00
README.md feat(README): Add Discord Server 2020-12-02 10:00:14 +05:30
tsconfig.json MASSIVE UPDATE NOW WITH EVENTS 2020-10-30 23:51:40 +09:00

harmony

banner

standard-readme compliant Discord

An easy to use Discord API Library for Deno.

  • Lightweight and easy to use.
  • Built-in Command Framework,
    • Easily build Commands on the fly.
    • Completely Customizable.
    • Complete Object-Oriented approach.
  • 100% Discord API Coverage.
  • Customizable caching.
    • Built in support for Redis.
    • Write Custom Cache Adapters.
  • Complete TypeScript support.

Note: Library is yet under development and not completely usable. You're still always welcome to use, but there may be breaking changes.

Table of Contents

Usage

Right now, the package is not published anywhere, as its not completely usable. You can import it from this Raw GitHub URL: https://raw.githubusercontent.com/harmony-org/harmony/main/mod.ts

For a quick example, run this:

deno run --allow-net https://raw.githubusercontent.com/harmony-org/harmony/main/examples/ping.ts

And input your bot's token and Intents.

Here is a small example of how to use harmony,

import { Client, Message, Intents } from 'https://raw.githubusercontent.com/harmony-org/harmony/main/mod.ts'

const client = new Client()

// Listen for event when client is ready (Identified through gateway / Resumed)
client.on('ready', () => {
  console.log(`Ready! User: ${client.user?.tag}`)
})

// Listen for event whenever a Message is sent
client.on('messageCreate', (msg: Message): void => {
  if (msg.content === '!ping') {
    msg.channel.send(`Pong! WS Ping: ${client.ping}`)
  }
})

// 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)

Or with CommandClient!

import { CommandClient, Command, CommandContext, Message, Intents } from 'https://raw.githubusercontent.com/harmony-org/harmony/main/mod.ts'

const client = new CommandClient({
  prefix: '!'
})

// Listen for event when client is ready (Identified through gateway / Resumed)
client.on('ready', () => {
  console.log(`Ready! User: ${client.user?.tag}`)
})

// Create a new Command
class PingCommand extends Command {
  name = "ping"

  execute(ctx: CommandContext) {
    ctx.message.reply(`pong! Ping: ${ctx.client.ping}ms`)
  }
}

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)

Docs

Not made yet.

Discord

Widget for the Discord Server

Maintainer

@Helloyunho

Contributing

See the contributing file!

PRs are accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT © 2020 Harmony Org