Table of Contents

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

context RuntimeContext

The current runtime context.

Returns

DiscordInit

Returns the DiscordInit. Returns null if Discord wasn't initialized.

GetDiscordChannel(RuntimeContext)

Returns the Discord channel from the current context.

public static IChannel? GetDiscordChannel(this RuntimeContext context)

Parameters

context RuntimeContext

The 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

context RuntimeContext

The current runtime context.

guild IExpression

The expression to resolve the guid id or name.

channel IExpression

The 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

context RuntimeContext

The 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

context RuntimeContext

The 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

context RuntimeContext

The current runtime context.

guild IExpression

The 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

context RuntimeContext

The current runtime context.

expression IExpression

The 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

context RuntimeContext

The current runtime context.

Returns

IUser

Returns the user, if found.