Esempio n. 1
0
 /// <summary>
 /// Member joined
 /// </summary>
 /// <param name="discordChannel">Discord channel</param>
 /// <param name="entry">Entry</param>
 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
 private async Task OnJoined(DiscordChannel discordChannel, GuildLogEntry entry)
 {
     if (discordChannel != null)
     {
         await discordChannel.SendMessageAsync(LocalizationGroup.GetFormattedText("MemberJoined", "**{0}** joined the guild.", entry.User))
         .ConfigureAwait(false);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Member kicked
 /// </summary>
 /// <param name="discordChannel">Discord channel</param>
 /// <param name="entry">Entry</param>
 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
 private async Task OnKick(DiscordChannel discordChannel, GuildLogEntry entry)
 {
     if (discordChannel != null)
     {
         if (entry.User == entry.KickedBy)
         {
             await discordChannel.SendMessageAsync(LocalizationGroup.GetFormattedText("MemberLeft", "**{0}** left the guild.", entry.User))
             .ConfigureAwait(false);
         }
         else
         {
             await discordChannel.SendMessageAsync(LocalizationGroup.GetFormattedText("MemberKicked", "**{0}** got kicked out of the guild by {1}.", entry.User, entry.KickedBy))
             .ConfigureAwait(false);
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Rank changed
 /// </summary>
 /// <param name="guildRankService">Guild rank service</param>
 /// <param name="guildId">Id of the guild</param>
 /// <param name="entry">Entry</param>
 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
 private Task OnRankChanged(GuildRankService guildRankService, long guildId, GuildLogEntry entry)
 {
     return(guildRankService.RefreshDiscordRank(guildId, entry.User, entry.NewRank));
 }