Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Form1
- using System.Text;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- using System.Diagnostics;
- namespace Grafik
- {
- public partial class Form1 : Form
- {
- DiscordUpdates Updates = new DiscordUpdates();
- public Form1()
- {
- InitializeComponent();
- this.Load += Loaded;
- }
- public async void Loaded(object sender, EventArgs args)
- {
- await Updates.StartAsync();
- }
- }
- }
- //Discord.net
- using System;
- using System.Linq;
- using System.Threading.Tasks;
- using Discord;
- using Discord.Commands;
- using Discord.WebSocket;
- namespace Grafik
- {
- public class DiscordUpdates : ModuleBase<SocketCommandContext>
- {
- private DiscordSocketClient _client = new DiscordSocketClient();
- public async Task StartAsync()
- {
- string discordToken = "TOKEN";
- await _client.LoginAsync(TokenType.Bot, discordToken, true);
- await _client.StartAsync();
- Console.WriteLine(1);
- var Message = await Context.Channel.GetMessagesAsync(2).FirstOrDefault();
- Console.WriteLine(2);
- Console.WriteLine(Message.ToString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement