public async Task Greeting(SocketGuildUser user) { var server = await _misc.GetOrCreateServer(user.Guild.Id); if (server.DoGreet) { ISocketMessageChannel msgChannel = null; if (server.GreetingRoom != 0) { msgChannel = user.Guild.GetChannel(server.GreetingRoom) as ISocketMessageChannel; } else { msgChannel = user.Guild.DefaultChannel as ISocketMessageChannel; } var embed = new EmbedBuilder(); embed.Title = $"{user.Username} has joined {user.Guild.Name}!"; embed.Description = server.GreetingMsg.Replace("#user", $"<@{user.Id}>"); embed.ThumbnailUrl = user.GetAvatarUrl(); embed.WithColor(Color.Green); await msgChannel.SendMessageAsync("", false, embed.Build()); _logger.LogInformation($"New user {user.Id} in {server.ServerId}"); } else { return; } }
public async Task ConfigureRole(ulong post) { var server = await _misc.GetOrCreateServer(Context.Guild.Id); server.RolePostId = post; _db.ServersSettings.Update(server); await _db.SaveChangesAsync(); }
public async Task ConfigurePrefix(string prefix) { var server = await _miscDb.GetOrCreateServer(Context.Guild.Id); server.prefix = Char.Parse(prefix); _dataBase.ServersSettings.Update(server); await _dataBase.SaveChangesAsync(); await ReplyAsync("Server prefix to H.u.e database"); }