-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample_bot.sp
More file actions
47 lines (37 loc) · 1.23 KB
/
example_bot.sp
File metadata and controls
47 lines (37 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <sourcemod>
#include <discord>
#pragma tabsize 0;
#pragma newdecls required;
#pragma semicolon 1;
public Plugin myinfo =
{
name = "Discord Bot Example",
author = "Nexd",
description = "Doing random things",
version = "1.0",
url = "https://github.com/KillStr3aK"
};
#define BOT_TOKEN ""
public void OnPluginStart()
{
DiscordBot bot = new DiscordBot(BOT_TOKEN);
/* Send a random message with embed */
DiscordMessage message = new DiscordMessage("Aye!");
DiscordEmbed embed = new DiscordEmbed();
embed.WithDescription("Random Description");
embed.WithAuthor(new DiscordEmbedAuthor("Example Bot", "https://github.com/KillStr3aK"));
embed.WithFooter(new DiscordEmbedFooter("NEXD @ Eternar"));
message.Embed(embed);
bot.SendMessageToChannelID("866539462401982514", message);
/* -- */
/* Create reaction */
bot.CreateReactionID("866539462401982514", "869072008464441405", DiscordEmoji.FromName(":100:"));
/* -- */
/* Delete animated custom reaction that was created by this bot */
bot.DeleteOwnReactionID("866539462401982514", "869072008464441405", DiscordEmoji.FromName("a:heartrainbow:842923225397985340"));
/* -- */
/* Delete message */
bot.DeleteMessageID("866539462401982514", "869047387413413888");
/* -- */
bot.Dispose();
}