diff --git a/README.md b/README.md index 9933941..88c622b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ # Usage ```TS -import { Client } from 'https://deno.land/x/katana/mod.ts' +import { Client, MessageEmbed } from 'https://deno.land/x/katana/mod.ts' const client = new Client(); @@ -26,15 +26,18 @@ client.on('ready', () => { client.on('message', (message) => { if (message.content === 'hello') { - message.channel.send('Hello World!); + message.channel.send('Hello World!'); } else if (message.content === 'embed') { - message.channel.send({ - embed: { title: 'hello' } - }); + const embed = new MessageEmbed() + .setDescription('hello world') + .setColor(13198335) + .setTitle('This is an embed'); + message.channel.send(embed); } }); client.login('token'); + ``` # Features diff --git a/mod.ts b/mod.ts index 4225a2a..94bf759 100644 --- a/mod.ts +++ b/mod.ts @@ -4,4 +4,14 @@ export { Message } from "./src/models/Message.ts"; export { BaseChannel } from "./src/models/channels/BaseChannel.ts"; export { TextChannel } from "./src/models/channels/TextChannel.ts"; export { CategoryChannel } from "./src/models/channels/CategoryChannel.ts"; -export { VoiceChannel } from "./src/models/channels/VoiceChannel.ts"; \ No newline at end of file +export { VoiceChannel } from "./src/models/channels/VoiceChannel.ts"; +export { + MessageEmbed, + MessageEmbedAuthor, + MessageEmbedField, + MessageEmbedFooter, + MessageEmbedImage, + MessageEmbedProvider, + MessageEmbedThumbnail, + MessageEmbedVideo +} from './src/models/embeds/Embeds.ts'; \ No newline at end of file diff --git a/src/constants/Payloads.ts b/src/constants/Payloads.ts index b1898f9..8ada1bb 100644 --- a/src/constants/Payloads.ts +++ b/src/constants/Payloads.ts @@ -11,8 +11,8 @@ export const Identify = { token: "", properties: { $os: "linux", - $browser: "denocord", - $device: "denocord", + $browser: "katana", + $device: "katana", }, }, }; diff --git a/src/handlers/MESSAGE_CREATE.ts b/src/handlers/MESSAGE_CREATE.ts index 786d6f8..0137bfe 100644 --- a/src/handlers/MESSAGE_CREATE.ts +++ b/src/handlers/MESSAGE_CREATE.ts @@ -5,7 +5,6 @@ import { buildMessage } from '../utils/resolvers.ts'; export default async function (client: Client, payload: Payload) { const { d: message_payload } = payload; - console.log(payload); const message = await buildMessage(client, message_payload); message.channel.messages.set(message.id, message); client.emit(Events.MESSAGE_CREATE, message); diff --git a/src/index.ts b/src/index.ts index d1118fa..aa9ae66 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,7 +45,9 @@ client.on("message", async (message: Message) => { await msg.edit(embed); }, 5500); } else if (message.content === '?embed') { - + const embed = new MessageEmbed() + .setDescription('hi'); + message.channel.send(embed); } else if(message.content === '?fetch') { await message.fetch(); } else if (message.content === '?pin') {