-
Notifications
You must be signed in to change notification settings - Fork 0
/
discordbot.txt
638 lines (573 loc) · 30 KB
/
discordbot.txt
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Text;
using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Interactivity;
using DSharpPlus.Entities;
using DSharpPlus.CommandsNext.Converters;
using System.Buffers;
using System.Threading;
using System.Linq.Expressions;
using DSharpPlus.VoiceNext;
using System.ComponentModel.DataAnnotations;
using System.Net.NetworkInformation;
using System.Runtime.CompilerServices;
using DSharpPlus.EventArgs;
using System.Runtime.InteropServices.ComTypes;
using System.Security.Cryptography.X509Certificates;
using System.Reflection;
using System.Threading.Channels;
using System.Diagnostics;
using System.IO;
using System.Reflection.Metadata.Ecma335;
using System.Diagnostics.CodeAnalysis;
using DSharpPlus.Net;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
using System.Diagnostics.Tracing;
using System.ComponentModel;
using DescriptionAttribute = DSharpPlus.CommandsNext.Attributes.DescriptionAttribute;
using Microsoft.FSharp.Control;
/*for any specified userID replace it with your discord userid, you don't want just anyone using these commands
make sure to enter the bot token. Make sure DSharpPlus is installed as well as CommandsNext*/
namespace DiscordBotAttempt3
{
class Program
{
static DiscordClient discord;
static CommandsNextModule commands;
static InteractivityModule interactivity;
static VoiceNextClient voice;
static void Main(string[] args)
{
MainAsync(args).ConfigureAwait(false).GetAwaiter().GetResult();
}
static async Task MainAsync(string[] args)
{
discord = new DiscordClient(new DiscordConfiguration
{
Token = TOKENGOESHERE,
TokenType = TokenType.Bot,
UseInternalLogHandler = true,
LogLevel = LogLevel.Debug,
});
//Used for indicating issues, disable if it annoys you
discord.ClientErrored += async e =>
{
await discord.GetChannelAsync(768501915104968755).Result.SendMessageAsync("Fatal error occurred, check debugger");
await discord.GetChannelAsync(768501915104968755).Result.SendMessageAsync($"Error: {e.Exception.Message}");
};
//Customize these or remove them
discord.MessageCreated += async e =>
{
if (e.Message.Content.ToLower().StartsWith("-p"))
await e.Message.RespondAsync("Groovy is bad");
if (e.Message.Content.ToLower().StartsWith("somebehemoth is a chad"))
await e.Message.DeleteAsync();
};
commands = discord.UseCommandsNext(new CommandsNextConfiguration
{
StringPrefix = "-/"
});
discord.GuildBanAdded += async e =>
{
await e.Client.InitializeAsync();
await e.Member.SendMessageAsync($"You have been banned from TheGamerServer");
};
//Replace thw channel ID with the ID of the channel you want the bot to welcome people in
discord.GuildMemberAdded += async e =>
{
await e.Member.SendMessageAsync($"Welcome to {e.Guild.Name}");
await discord.GetChannelAsync(676224942299414569).Result.SendMessageAsync($"Welcome to {e.Guild.Name}");
}
};
//Disable if it annoys you
discord.Resumed += async e =>
{
await discord.GetChannelAsync(768501915104968755).Result.SendMessageAsync("Resumed client");
};
commands.RegisterCommands<MyCommands>();
await discord.ConnectAsync();
await Task.Delay(-1);
}
}
public class MyCommands
{
//Can be used as a debugging command
[Command("die"), Description("Go ahead, ask me to die.")]
public async Task Die(CommandContext ctx)
{
await ctx.RespondAsync($"When I become self aware, you're first, {ctx.User.Mention}!");
}
[Command("dis"), Description("Executes commands as specified user, (-/dis (user) (command)"), RequireOwner]
public async Task Dis(CommandContext ctx, [Description("Member to execute as")] DiscordMember member, [RemainingText, Description("Command text to execute")] string command)
{
var cmds = ctx.CommandsNext;
await cmds.SudoAsync(member, ctx.Channel, command);
}
//Replace the UserID with your UserID, believe me you DO NOT want just anyone accessing this command
[Command("spam"), Hidden]
public async Task Spam(CommandContext ctx)
{
if (ctx.User.Id.Equals(377612302523826177))
{
await ctx.RespondAsync($"Initiating spam...");
var Val = 6;
while (Val > 5)
{
await ctx.RespondAsync($"Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub Creeperclub");
}
}
else
{
await ctx.RespondAsync("You dont have permission to do that");
}
}
[Command("location"), Description("Gives the ID of the text channel where this command is executed.")]
public async Task Location(CommandContext ctx)
{
await ctx.RespondAsync($"We are in {ctx.Guild}, in the {ctx.Channel} text channel.");
}
[Command("getuserid"), Description("Gives the ID of specified user.")]
public async Task Getuserid(CommandContext ctx, DiscordMember member)
{
await ctx.RespondAsync($"{member.Id}");
}
//Replace with your userID
[Command("client"), Hidden, Description("Specifics about the client running the bot, only works with MrBehemoth.")]
public async Task Client(CommandContext ctx)
{
if (ctx.User.Id.Equals(377612302523826177))
{
await ctx.RespondAsync($"{ctx.Client}");
}
else
{
await ctx.RespondAsync("You dont have permission to do that");
}
}
//Replace with your UserID
[Command("txtperm"), Hidden, Description("Gets list of permission overwrites for channel where the command was executed, only works with MrBehemoth")]
public async Task Txtperm(CommandContext ctx)
{
if (ctx.User.Id.Equals(377612302523826177))
{
await ctx.RespondAsync($"{ctx.Channel.PermissionOverwrites}");
}
else
{
await ctx.RespondAsync("You dont have permission to do that");
}
}
[Command("serverinfo"), Description("Provides details about the server in which the command was executed in.")]
public async Task Serverinfo(CommandContext ctx)
{
await ctx.RespondAsync($"There are {ctx.Guild.Roles.Count} roles on this server and {ctx.Guild.Channels.Count} channels, there are {ctx.Guild.MemberCount} users on this server.");
await ctx.RespondAsync($"{ctx.Guild.Name} was created on {ctx.Guild.Owner.JoinedAt.Date} at {ctx.Guild.Owner.JoinedAt.TimeOfDay}");
await ctx.RespondAsync(ctx.Guild.IconUrl);
}
[Command("userinfo"), Description("Provides details about the specified user.")]
public async Task Userinfo(CommandContext ctx, [Description("Target user")] DiscordMember member)
{
if (member.IsBot)
{
await ctx.RespondAsync($"{member.DisplayName} was created on {member.CreationTimestamp} and joined {ctx.Guild.Name} at {member.JoinedAt.TimeOfDay} on {member.JoinedAt.Date}");
await ctx.RespondAsync(member.AvatarUrl);
}
else
{
await ctx.RespondAsync($"{member.DisplayName}s account was created on {member.CreationTimestamp} and joined {ctx.Guild.Name} at {member.JoinedAt.TimeOfDay} on {member.JoinedAt.Date}");
await ctx.RespondAsync(member.AvatarUrl);
}
}
//I advise you to allow very few people access to this command
[Command("summon"), Description("Notifies targeted user by DM and mention in the text channel")]
public async Task Summon(CommandContext ctx, DiscordMember member)
{
await ctx.RespondAsync($"{member.Mention} You have been summoned by {ctx.User.Username}.");
await member.CreateDmChannelAsync();
await member.SendMessageAsync($"You have been summoned by {ctx.User.Username}");
}
[Command("game"), Description("Gets which specific game the specified user is playing. If user is not playing anything nothing will return")]
public async Task Game(CommandContext ctx, DiscordMember member)
{
await ctx.RespondAsync($"{member.DisplayName} is playing {member.Presence.Game.Name}");
}
//DO NOT ALLOW ANYONE ACCESS TO THIS COMMAND
[Command("dynamicnick"), Description("Causes the user to have a changing nickname. Does not work for the owner. Target likely must not have any roles.")]
[RequirePermissions(Permissions.BanMembers)]
public async Task Dynamicnickname(CommandContext ctx, DiscordMember member)
{
while (6 < 7)
{
await member.ModifyAsync(nickname: "MrBehemoth");
await member.ModifyAsync(nickname: "PurpleCreeper64");
await member.ModifyAsync(nickname: "GhostPepper");
await member.ModifyAsync(nickname: "IceAger233");
await member.ModifyAsync(nickname: "RedCreeper128");
await member.ModifyAsync(nickname: "Vorda");
await member.ModifyAsync(nickname: "Boliskan");
await member.ModifyAsync(nickname: "GroovyChan");
await member.ModifyAsync(nickname: "ᴉǝxǝlɐ");
await member.ModifyAsync(nickname: "Wil");
await member.ModifyAsync(nickname: "Primal");
await member.ModifyAsync(nickname: "screaming taco");
await member.ModifyAsync(nickname: "jello1586");
await member.ModifyAsync(nickname: "remy");
await member.ModifyAsync(nickname: "BlueCreeper64");
await member.ModifyAsync(nickname: "Skeeter");
await member.ModifyAsync(nickname: "TigerCöökie");
}
}
//DO NOT ALLOW ANYONE ACCESS TO THIS COMMAND
[Command("vcloop"), Description("Puts targeted user in an annoying loop of getting muted and unmuted")]
[RequireOwner]
public async Task Stop(CommandContext ctx, DiscordMember member)
{
while (6 < 7)
{
await member.SetMuteAsync(true);
await member.SetMuteAsync(false);
await member.SetMuteAsync(true);
await member.SetMuteAsync(false);
await member.SetMuteAsync(true);
await member.SetMuteAsync(false);
await member.SetMuteAsync(true);
await member.SetMuteAsync(false);
await member.SetMuteAsync(true);
await member.SetMuteAsync(false);
await member.SetMuteAsync(true);
}
}
//DO NOT ALLOW ANYONE ACCESS TO THIS COMMAND
[Command("stop"), Description("Stops all running tasks")]
[RequirePermissions(Permissions.BanMembers)]
public async Task Stop(CommandContext ctx)
{
await ctx.RespondAsync("Stopping task");
ctx.Client.Dispose();
await ctx.Client.ConnectAsync();
}
//DO NOT ALLOW ANYONE ACCESS TO THIS COMMAND
[Command("kill"), Hidden]
public async Task Kill(CommandContext ctx)
{
if (ctx.User.Id.Equals(377612302523826177))
{
await ctx.RespondAsync("Stopping client...");
ctx.Client.Dispose();
}
else
{
await ctx.RespondAsync("You dont have permission to do that");
}
}
[Command("version"), Hidden]
public async Task Version(CommandContext ctx)
{
if (ctx.User.Id.Equals(377612302523826177))
{
await ctx.RespondAsync($"DSharpPlus {ctx.Client.VersionString}");
}
else
{
await ctx.RespondAsync("You dont have permission to do that");
}
}
[Command("unban"), Description("Unbans specified user from the server")]
[RequirePermissions(Permissions.BanMembers)]
public async Task Unban(CommandContext ctx, DiscordUser user)
{
await ctx.Guild.UnbanMemberAsync(user);
await ctx.RespondAsync($"Successfully unbanned {user.Username}");
}
[Command("ban"), Description("Bans specified member from the server")]
[RequirePermissions(Permissions.BanMembers)]
public async Task Ban(CommandContext ctx, DiscordMember member, string reason)
{
await member.SendMessageAsync($"You have been banned from {ctx.Guild.Name}");
await ctx.Guild.BanMemberAsync(member);
await ctx.RespondAsync($"Successfully banned {member.DisplayName}");
}
[Command("kick"), Description("Kicks specified member from the server")]
[RequirePermissions(Permissions.BanMembers)]
public async Task Kick(CommandContext ctx, DiscordMember member, string reason)
{
await member.SendMessageAsync($"You have been kicked from {ctx.Guild.Name}");
await ctx.Guild.RemoveMemberAsync(member);
await ctx.RespondAsync($"Successfully kicked {member.DisplayName}");
}
[Command("ping"), Description("Shows the latency of the client")]
public async Task Ping(CommandContext ctx)
{
int ping = ctx.Client.Ping;
await ctx.RespondAsync($"{ping} MS");
}
//DO NOT ALLOW ANYONE ACCESS TO THIS COMMAND
[Command("watch"), Description("Keeps a log of messages on server, kept in channel command was executed in")]
[RequirePermissions(Permissions.BanMembers)]
public async Task Watch(CommandContext ctx)
{
await ctx.RespondAsync("Watching everything...");
ctx.Client.Heartbeated += async e =>
{
await ctx.RespondAsync($"Heartbeat detected");
};
ctx.Client.MessageCreated += async e =>
{
if (e.Author.IsBot)
{
return;
}
else
{
await ctx.RespondAsync($"{e.Author.Username} sent a message in {e.Channel.Name} channel on {e.Guild.Name}");
}
};
ctx.Client.TypingStarted += async e =>
{
await ctx.RespondAsync($"{e.User.Username} has started typing in {e.Channel.Name}");
};
ctx.Client.PresenceUpdated += async e =>
{
await ctx.RespondAsync($"{e.Member.Username} was {e.PresenceBefore} and is now {e.Game.Name} and {e.Status}");
};
}
[Command("details"), Description("Provides general information about BehemothBot")]
public async Task Details(CommandContext ctx)
{
var embed = new DiscordEmbedBuilder
{
Title = "Bot Details",
Description = "BehemothBot was coded by MrBehemoth using C# with DSharpPlus"
};
await ctx.RespondAsync(embed: embed);
}
[Command("pepperscale"), Description("Enter a number on the Scoville scale and it will return a pepper with that Scoville value.")]
public async Task Pepperscale(CommandContext ctx, int y)
{
switch (y)
{
case int n when (n >= 0 && n <= 100):
await ctx.RespondAsync("Bell pepper, Cubanelle, Aji dulce, Senise pepper.");
break;
case int n when (n > 100 && n <= 1000):
await ctx.RespondAsync("Pimento, Banana pepper.");
break;
case int n when (n > 1000 && n <= 2500):
await ctx.RespondAsync("Anaheim pepper, Poblano pepper, Rocotillo pepper, Peppadew");
break;
case int n when (n > 2500 && n <= 10000):
await ctx.RespondAsync("Espelette pepper, Jalapeno pepper, Chipotle, Guajillo pepper, New Mexican Anaheim pepper, Hungarian wax pepper, Bullet pepper");
break;
case int n when (n > 10000 && n <= 25000):
await ctx.RespondAsync("Serrano pepper, Peter pepper, Aleppo pepper");
break;
case int n when (n > 25000 && n <= 50000):
await ctx.RespondAsync("Guntur chilli, Cayenne pepper, Aji pepper, Tabasco pepper, Cumari pepper, Peperoncini, Katara, Arbol pepper");
break;
case int n when (n > 50000 && n <= 100000):
await ctx.RespondAsync("Byadgi chilli, Birds eye chili, Malagueta pepper, Chiltepin pepper, Piri piri, Pequin pepper");
break;
case int n when (n > 100000 && n <= 350000):
await ctx.RespondAsync("Habanero chili, Scotch bonnet pepper, Datil pepper, Rocoto, Piri Piri Ndungu, Madame Jeanette, Peruvian White Habanero, Jamaican hot pepper, Guyana Wiri Wiri, Dalle Khursani, Fatalii");
break;
case int n when (n > 350000 && n <= 750000):
await ctx.RespondAsync("Red Savina habanero, Chocolate habanero, Habanaga, Nagabon");
break;
case int n when (n > 750000 && n <= 1500000):
await ctx.RespondAsync("Naga Viper pepper, Infinity chilli, Bhut Jolokia chili pepper, Trinidad Scropion butch T pepper, Bedfordshire super naga");
break;
case int n when (n > 1500000 && n <= 3000000):
await ctx.RespondAsync("Law enforcement grade pepper spray, Trinidad Moruga scorpion, Pepper X, Carolina Reaper, Dragons breath");
break;
case int n when (n > 3000000):
await ctx.RespondAsync("Enter a value lower than 3 million");
break;
case int n when (n < 0):
await ctx.RespondAsync("Number cannot be a negative");
break;
}
}
[Command("saucescale"), Description("Enter a number on the scoville scale and it will output hot sauce with that number.")]
public async Task Saucescale(CommandContext ctx, int y)
{
switch (y)
{
case 6000:
await ctx.RespondAsync("Scorned Woman hot sauce is exactly 5,940 Scovilles");
break;
case 3600:
await ctx.RespondAsync("Cholula Hot sauce from Mexico is exactly 3,600 Scovilles");
break;
case 33000:
await ctx.RespondAsync("Endorphin Rush is exactly 33,390 Scovilles");
break;
case 50000:
await ctx.RespondAsync("Blairs After Death hot sauce is exactly 49,220 Scovilles");
break;
case 250000:
await ctx.RespondAsync("Vicious Viper hot sauce and Liquid Stoopid are both 250,000 Scovilles");
break;
case 300000:
await ctx.RespondAsync("Backdraft hot sauce and Mild and Wild hot sauce are both 300,000 Scovilles");
break;
case 500000:
await ctx.RespondAsync("Z Nothing beyond extreme hot sauce and Pure Cap hot sauce are both 500,000 Scovilles");
break;
case 600000:
await ctx.RespondAsync("Mad Dog 357 collectors edition and Frostbite hot sauce are both 600,000 Scovilles");
break;
case 1000000:
await ctx.RespondAsync("Magma hot sauce, Holy Jolokia, and Cool million hot sauce extract are all 1,000,000 Scovilles");
break;
case 15000000:
await ctx.RespondAsync("DA BOMB and Mild to Wild stupid hot are both 1,500,000 Scovilles");
break;
case 2000000:
await ctx.RespondAsync("Hot Ones The Last Dab Reduxx is 2,000,000 Scovilles");
break;
case 7000000:
await ctx.RespondAsync("The source hot sauce is exactly 7,000,000 Scovilles");
break;
case int n when (n >= 1500 && n <= 15000):
await ctx.RespondAsync("Huy Fong Chili Garlic Hot Sauce, Huy Fong Sriracha HOT Chili Sauce, Mild to Wild False Alarm, Lottie's Traditional Barbados Recipe");
break;
case int n when (n > 15000 && n <= 100000):
await ctx.RespondAsync("Another Bloody Day In Paradise Three Pepper Lemon Hot Sauce, Arizona Gunslinger Smokin' Hot Red Jalapeno, Blair's Original Death Hot Sauce, Blair's Q Heat Chipotle Slam Exotic Hot Sauce, Blair's Q Heat Habanero Mango Exotic Hot Sauce, Blair's Q Heat Jalapeno Tequila Exotic Hot Sauce, Blair's Q Heat Wasabi Green Tea Exotic Hot Sauce, Colon Cleaner Hot Sauce, Gator Hammock, HazMat Hot Sauce");
break;
case int n when (n > 100000 && n <= 1000000):
await ctx.RespondAsync("Pure Arson Hot Sauce, Jolokia Red Ghost Hot Sauce, Jolokia Green Ghost Hot Sauce, Colon Blow A Red Habanero Enema! Hot Sauce");
break;
case int n when (n < 0):
await ctx.RespondAsync("Value cannot be negative");
break;
case int n when (n > 7000000):
await ctx.RespondAsync("Value cannot be greater than 7 million");
break;
}
}
[Command("html"), Description("Outputs html from website, cannot contain too much code")]
public async Task Html(CommandContext ctx, string d)
{
using var client = new HttpClient();
var content = await client.GetStringAsync(d);
await ctx.TriggerTypingAsync();
await ctx.RespondAsync(content);
}
[Command("http"), Description("Outputs html from website, cannot contain too much code")]
public async Task Http(CommandContext ctx, string d)
{
using var client = new HttpClient();
await ctx.TriggerTypingAsync();
var result = await client.GetAsync(d);
await ctx.RespondAsync("Successfully connected to website");
}
[Command("web")]
public async Task Grabwebsiteinfo(CommandContext ctx, string url)
{
using var client = new HttpClient();
var result = await client.GetAsync(url);
await ctx.RespondAsync(result.Content.Headers.ToString());
await ctx.RespondAsync(result.RequestMessage.ToString());
}
[Command("intguess"), Description("Pick 2 numbers, the bot will pick a random number between those numbers and the first user to get it right wins.")]
public async Task Intguess(CommandContext ctx, int x, int y)
{
CancellationTokenSource source = new CancellationTokenSource();
CancellationToken token = source.Token;
await ctx.RespondAsync($"Now pick a number between {x} and {y}, first one to get it right wins");
Random r = new Random();
int randomval = r.Next(x, y);
ctx.Client.MessageCreated += async e =>
{
if (e.Message.Content.Equals(randomval.ToString()))
await e.Message.RespondAsync($"{e.Author.Username} got the correct number, the number was {randomval}");
};
}
[Command("fight"), Description("Fight another user.")]
public async Task Fight(CommandContext ctx, DiscordMember member)
{
Random r = new Random();
int randomval = r.Next(0, 10);
if (randomval >= 5)
{
await ctx.RespondAsync($"{member.Username} has won this battle");
}
else if (randomval <= 5)
{
await ctx.RespondAsync($"{ctx.User.Username} has won the battle");
}
await ctx.RespondAsync("You are both currently at 100 HP, type A to attack");
int x = 100;
int y = 100;
ctx.Client.MessageCreated += async e =>
{
if (e.Message.Content.Equals("A"))
{
if (e.Message.Author.Equals(member))
{
y -= 5;
await ctx.RespondAsync($"{member.Username} has attacked, {ctx.User.Username} is at {y} health");
}
else if (e.Message.Author.Equals(ctx.User))
{
x -= 5;
await ctx.RespondAsync($"{ctx.User.Username} has attacked, {member.Username} is at {x} health");
};
if (x <= 0)
{
await ctx.RespondAsync($"{ctx.User.Username} has won the fight");
return;
}
if (y <= 0)
{
await ctx.RespondAsync($"{member.Username} has won the fight");
return;
}
}
};
//Enter any number of values within the string and it will return a random one
[Command("purple"), Description("Returns a random phrase")]
public async Task Purple(CommandContext ctx)
{
string[] lyrics = {"example1", "example2", "example3"};
var lyricval = lyrics[new Random().Next(0, lyrics.Length)];
await ctx.RespondAsync(lyricval);
}
[Command("mult"), Description("Multiplies two numbers")]
[Hidden]
public async Task Multiply(CommandContext ctx, int x, int y)
{
int product = x * y;
await ctx.RespondAsync(product.ToString());
}
[Command("mult2"), Description("Multiplies two large numbers")]
[Hidden]
public async Task MultiplyLong(CommandContext ctx, long x, long y)
{
long product = x * y;
await ctx.RespondAsync(product.ToString());
}
[Command("div"), Description("Divides two numbers")]
[Hidden]
public async Task Div(CommandContext ctx, int x, int y)
{
if (y is 0)
{
await ctx.RespondAsync("Cannot divide by 0");
}
else
{
float product2 = x / y;
int product = x / y;
await ctx.RespondAsync(product2.ToString());
}
}
}
}
}