-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiscordBotConfig.cs
53 lines (40 loc) · 2.64 KB
/
DiscordBotConfig.cs
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
using System;
using System.Collections.Generic;
using System.Text;
using Discord;
namespace DiscordBotBase
{
/// <summary>Common configurable options for a Discord bot.</summary>
public class DiscordBotConfig
{
/// <summary>The message to display when an unknown command is input (if any).</summary>
public string UnknownCommandMessage = "Unknown command. Consider the __**help**__ command?";
/// <summary>An alternate handler for unknown commands (eg special info output) (if any).</summary>
public Action<string, CommandData> UnknownCommandHandler = null;
/// <summary>A method that will return a bool indicating whether the client should respond to commands in the message given in the parameter (usually based on the channel details).</summary>
public Func<IUserMessage, bool> ShouldPayAttentionToMessage = null;
/// <summary>A method to run to initialize the bot.</summary>
public Action<DiscordBot> Initialize = null;
/// <summary>Extra message handling, after command handling is done.</summary>
public Action<IUserMessage> OtherMessageHandling = null;
/// <summary>Logic to run when the bot's about to shutdown.</summary>
public Action OnShutdown = null;
/// <summary>The command prefix to use, if any. (If null, requires a direct ping).</summary>
public string CommandPrefix = "!";
/// <summary>
/// How many messages per channel to cache by default.
/// This value can be overriden by the "discord_cache_size" config.fds option.
/// </summary>
public int CacheSize = 256;
/// <summary>Whether to automatically forcibly pre-fill the cache at startup.</summary>
public bool EnsureCaching = false;
/// <summary>Whether to allow direct messages (if not, only guild messages are allowed).</summary>
public bool AllowDMs = false;
/// <summary>What gateway intents to connect with. Defaults to 'AllUnprivileged | GuildMessages | GuildMessageReactions | MessageContent | GuildMembers'.</summary>
public GatewayIntents GatewayIntents = GatewayIntents.AllUnprivileged | GatewayIntents.GuildMessages | GatewayIntents.GuildMessageReactions | GatewayIntents.MessageContent | GatewayIntents.GuildMembers;
/// <summary>Whether DM'd slash commands are ever allowed.</summary>
public bool AllowSlashCommandsInDM = false;
/// <summary>A method that will return true if a bot message should be ignored, or false if it should be parsed. Note that webhooks are always ignored.</summary>
public Func<IMessage, bool> ShouldIgnoreBot = (_) => true;
}
}