Ejemplo n.º 1
0
        public async Task <IActionResult> UpdateMotd([FromRoute] ulong guildId, [FromBody] MotdForCreateDto motd)
        {
            await RequirePermission(guildId, DiscordPermission.Admin);

            Identity currentIdentity = await GetIdentity();

            return(Ok(await GuildMotdRepository.CreateDefault(_serviceProvider, currentIdentity).CreateOrUpdateMotd(guildId, motd.Message, motd.ShowMotd)));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetMotd([FromRoute] ulong guildId)
        {
            await RequirePermission(guildId, DiscordPermission.Moderator);

            Identity identity = await GetIdentity();

            GuildMotd motd = await GuildMotdRepository.CreateDefault(_serviceProvider, identity).GetMotd(guildId);

            IUser creator = await _discordAPI.FetchUserInfo(motd.UserId, CacheBehavior.Default);

            return(Ok(new GuildMotdExpandedView(motd, creator)));
        }