-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (27 loc) · 745 Bytes
/
Program.cs
File metadata and controls
32 lines (27 loc) · 745 Bytes
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
using System;
using System.Threading.Tasks;
using DisCatSharp.Examples.Basics.Main;
namespace DisCatSharp.Examples.Basics;
/// <summary>
/// The program.
/// </summary>
internal class Program
{
/// <summary>
/// Entry point.
/// </summary>
/// <param name="args">The args.</param>
private static async Task Main(string[] args)
{
var token = args.Length > 0
? args[0]
: Environment.GetEnvironmentVariable("DISCATSHARP_TOKEN") ?? Environment.GetEnvironmentVariable("DISCORD_TOKEN");
if (string.IsNullOrWhiteSpace(token))
{
Console.Error.WriteLine("Provide a bot token as the first argument or set DISCATSHARP_TOKEN / DISCORD_TOKEN.");
return;
}
using var bot = new Bot(token);
await bot.RunAsync();
}
}