I was looking and looking and looking and most of the codes seems to work but when I do this is the result:
Object reference not set to an object instance.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Discord.Commands;
using Discord;
using Discord.WebSocket;
namespace ConsoleApp1.Modules
{
public class code : ModuleBase<SocketCommandContext>
{
DiscordSocketClient _client = new DiscordSocketClient();
[Command("test")]
[RequireBotPermission(Discord.GuildPermission.ManageRoles)]
[RequireUserPermission(Discord.GuildPermission.ManageRoles)]
private async Task test()
{
await _client.GetGuild(470026969963167765).GetTextChannel(470026969963167767).SendMessageAsync("Message");
}
}
}
This one of the codes that I tried to use.