Пример #1
0
        public static async Task <bool> SetMyDefaultAdministratorRightsAsync(this BotClient api, [Optional] ChatAdministratorRights?rights, [Optional] bool?forChannels, [Optional] CancellationToken cancellationToken)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new SetMyDefaultAdministratorRightsArgs()
            {
                Rights      = rights,
                ForChannels = forChannels
            };

            return(await api.RPCA <bool>(MethodNames.SetMyDefaultAdministratorRights, args, cancellationToken).ConfigureAwait(false));
        }
Пример #2
0
        public static bool SetMyDefaultAdministratorRights(this BotClient api, [Optional] ChatAdministratorRights?rights, [Optional] bool?forChannels)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new SetMyDefaultAdministratorRightsArgs()
            {
                Rights      = rights,
                ForChannels = forChannels
            };

            return(api.RPC <bool>(MethodNames.SetMyDefaultAdministratorRights, args));
        }