Advertisement
Guest User

Untitled

a guest
Jan 8th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1.  
  2. //Form1
  3.  
  4. using System.Text;
  5. using System.Windows.Forms;
  6. using System.Runtime.InteropServices;
  7. using System.Diagnostics;
  8.  
  9. namespace Grafik
  10. {
  11. public partial class Form1 : Form
  12. {
  13. DiscordUpdates Updates = new DiscordUpdates();
  14.  
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. this.Load += Loaded;
  19. }
  20.  
  21. public async void Loaded(object sender, EventArgs args)
  22. {
  23. await Updates.StartAsync();
  24. }
  25.  
  26. }
  27. }
  28.  
  29. //Discord.net
  30.  
  31.  
  32. using System;
  33. using System.Linq;
  34. using System.Threading.Tasks;
  35. using Discord;
  36. using Discord.Commands;
  37. using Discord.WebSocket;
  38.  
  39. namespace Grafik
  40. {
  41. public class DiscordUpdates : ModuleBase<SocketCommandContext>
  42. {
  43. private DiscordSocketClient _client = new DiscordSocketClient();
  44.  
  45. public async Task StartAsync()
  46. {
  47. string discordToken = "TOKEN";
  48. await _client.LoginAsync(TokenType.Bot, discordToken, true);
  49. await _client.StartAsync();
  50.  
  51. Console.WriteLine(1);
  52. var Message = await Context.Channel.GetMessagesAsync(2).FirstOrDefault();
  53. Console.WriteLine(2);
  54. Console.WriteLine(Message.ToString());
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement