RoboZhando/Zhando.cs
/// <summary>
/// Resolves the prefix of the message and returns a index to trim from.
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
Resolves the prefix of the message and returns a index to trim from.
Resolves the prefix of the message and returns a index to trim from .
public async Task<int> ResolvePrefixAsync(DiscordMessage message)
        {
            try
            {
                if (message.Author == null || message.Author.IsBot)
                    return -1;
                string prefix = await GuildSettings.GetPrefixAsync(Redis, message.Channel.Guild);
                var pos = message.GetStringPrefixLength(prefix);
                return pos;
            }
            catch (Exception e)
            {
                this.Logger.LogError(e);
                return -1;
            }
        }
public async Task < int > ResolvePrefixAsync ( DiscordMessage message ) { try { if ( message . Author == null || message . Author . IsBot ) return - 1 ; string prefix = await GuildSettings . GetPrefixAsync ( Redis , message . Channel . Guild ) ; var pos = message . GetStringPrefixLength ( prefix ) ; return pos ; } catch ( Exception e ) { this . Logger . LogError ( e ) ; return - 1 ; } }
Resolves the prefix of the message and returns a index to trim from.
Resolves the prefix of the message and returns a index to trim from .
// We do not listen to bots // Get the position of the prefix // Return the index of the prefix
None
message
DiscordMessage
None