Skip to content

Bot Admins

TehGM edited this page Jul 10, 2020 · 2 revisions

Certain Commands require elevated permissions within bots settings. If user executing a command is not a bot admin, the command will result in an error response.

Current Bot Admins

Admin WOLF ID Role
TehGM 2644384 Bot admin, Bot developer, Database admin
Tala 385 Bot admin


Technical information

Setting user as admin

Currently setting an user as admin is only possible through Database edit.
User is a bot admin if user document in UsersData collection in Database has IsBotAdmin property set to true.

{
    "_id" : 2644384,
    "IsBotAdmin" : true
}

Checking if user is an admin

To check's bot user admin status, check IsBotAdmin property in user's UserData object after requesting it from DB.

private async Task<bool> CheckIfAdminAsync(ChatMessage message, CancellationToken cancellationToken = default)
{
    UserData userData = await _userDataStore.GetUserDataAsync(message.SenderID.Value, cancellationToken).ConfigureAwait(false);
    return userData.IsBotAdmin;
}

Clone this wiki locally