Class DiscordHelper
- Namespace
- BotManager.Discord
- Assembly
- BotManager.Discord.dll
A helper class for the Discord plugin.
public static class DiscordHelper
- Inheritance
-
DiscordHelper
- Inherited Members
Methods
GetDiscord(RuntimeContext)
Returns the global DiscordInit from the current context.
public static DiscordInit? GetDiscord(this RuntimeContext context)
Parameters
contextRuntimeContextThe current runtime context.
Returns
- DiscordInit
Returns the DiscordInit. Returns
nullif Discord wasn't initialized.
GetDiscordChannel(RuntimeContext)
Returns the Discord channel from the current context.
public static IChannel? GetDiscordChannel(this RuntimeContext context)
Parameters
contextRuntimeContextThe current runtime context.
Returns
- IChannel
Returns the channel, if found.
GetDiscordChannelAsync(RuntimeContext, IExpression?, IExpression?)
Returns the Discord channel from the current context.
public static Task<IChannel?> GetDiscordChannelAsync(this RuntimeContext context, IExpression? guild, IExpression? channel)
Parameters
contextRuntimeContextThe current runtime context.
guildIExpressionThe expression to resolve the guid id or name.
channelIExpressionThe expression to resolve the channel id or name.
Returns
- Task<IChannel>
Returns the channel, if found.
GetDiscordCommand(RuntimeContext)
Returns the Discord slash command from the current context.
public static SocketSlashCommand? GetDiscordCommand(this RuntimeContext context)
Parameters
contextRuntimeContextThe current runtime context.
Returns
- SocketSlashCommand
Returns the slash command, if found.
GetDiscordGuild(RuntimeContext)
Returns the Discord guild from the current context.
public static IGuild? GetDiscordGuild(this RuntimeContext context)
Parameters
contextRuntimeContextThe current runtime context.
Returns
- IGuild
Returns the guild, if found.
GetDiscordGuildAsync(RuntimeContext, IExpression?)
Returns the Discord guild from the current context.
public static Task<IGuild?> GetDiscordGuildAsync(this RuntimeContext context, IExpression? guild)
Parameters
contextRuntimeContextThe current runtime context.
guildIExpressionThe expression to resolve the guid id or name.
Returns
- Task<IGuild>
Returns the guild, if found.
GetDiscordIdentifierAsync(RuntimeContext, IExpression?)
Returns the identifier by an operation
public static Task<DiscordIdentifier?> GetDiscordIdentifierAsync(this RuntimeContext context, IExpression? expression)
Parameters
contextRuntimeContextThe current runtime context.
expressionIExpressionThe expression to resolve the id or name.
Returns
- Task<DiscordIdentifier?>
Returns the identifier with either id or name set.
GetDiscordUser(RuntimeContext)
Returns the Discord user from the current context.
public static IUser? GetDiscordUser(this RuntimeContext context)
Parameters
contextRuntimeContextThe current runtime context.
Returns
- IUser
Returns the user, if found.