Пример #1
0
        private async Task RemoveOldAndSetNewMessage(IUserMessage msg, LavaPlayer player)
        {
            string msgId  = CacheId.MusicCacheMessage(player.VoiceChannel.GuildId);
            var    oldMsg = _cache.Get <IUserMessage>(msgId);
            await oldMsg.MatchSome(async message => await message.DeleteAsync());

            _cache.Set(CacheId.MusicCacheMessage(player.VoiceChannel.GuildId), msg, TimeSpan.FromMinutes(_MSG_CACHE_TTL_MINS));
        }