Skip to content

Commit

Permalink
fix(msg-embeds): fixed some stuff with message embeds and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
stuyy committed May 25, 2020
1 parent 6e5a134 commit 9a88fc6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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
Expand Down
12 changes: 11 additions & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
export { VoiceChannel } from "./src/models/channels/VoiceChannel.ts";
export {
MessageEmbed,
MessageEmbedAuthor,
MessageEmbedField,
MessageEmbedFooter,
MessageEmbedImage,
MessageEmbedProvider,
MessageEmbedThumbnail,
MessageEmbedVideo
} from './src/models/embeds/Embeds.ts';
4 changes: 2 additions & 2 deletions src/constants/Payloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const Identify = {
token: "",
properties: {
$os: "linux",
$browser: "denocord",
$device: "denocord",
$browser: "katana",
$device: "katana",
},
},
};
Expand Down
1 change: 0 additions & 1 deletion src/handlers/MESSAGE_CREATE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 9a88fc6

Please sign in to comment.