Compare commits

...
2 Commits
Author SHA1 Message Date
Dustin Pianalto c504f7b165 fix get user sql query
CI / build (push) Has been cancelled
2021-01-25 01:38:22 -09:00
Dustin Pianalto 34564140f5 add request command
CI / build (push) Has been cancelled
2021-01-25 01:33:46 -09:00
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ type userService struct {
func (s userService) User(id string) (geeksbot.User, error) { func (s userService) User(id string) (geeksbot.User, error) {
var user geeksbot.User var user geeksbot.User
queryString := "SELECT id, steam_id, active, staff, admin WHERE id = $1" queryString := "SELECT id, steam_id, active, staff, admin FROM users WHERE id = $1"
row := s.db.QueryRow(queryString, id) row := s.db.QueryRow(queryString, id)
err := row.Scan(&user.ID, &user.SteamID, &user.IsActive, &user.IsStaff, &user.IsAdmin) err := row.Scan(&user.ID, &user.SteamID, &user.IsActive, &user.IsStaff, &user.IsAdmin)
return user, err return user, err
+2 -2
View File
@@ -31,12 +31,12 @@ func requestCommandFunc(ctx disgoman.Context, args []string) {
requestMsg := strings.Join(args, " ") requestMsg := strings.Join(args, " ")
author, err := services.UserService.GetOrCreateUser(ctx.Message.Author.ID) author, err := services.UserService.GetOrCreateUser(ctx.Message.Author.ID)
if err != nil { if err != nil {
discord_utils.SendErrorMessage(ctx, "Error creating the request", err) discord_utils.SendErrorMessage(ctx, "Error creating the request. Could not get user.", err)
return return
} }
channel, err := services.ChannelService.GetOrCreateChannel(ctx.Message.ChannelID, ctx.Guild.ID) channel, err := services.ChannelService.GetOrCreateChannel(ctx.Message.ChannelID, ctx.Guild.ID)
if err != nil { if err != nil {
discord_utils.SendErrorMessage(ctx, "Error creating the request", err) discord_utils.SendErrorMessage(ctx, "Error creating the request. Could not get channel.", err)
return return
} }
int64ID, _ := strconv.ParseInt(ctx.Message.ID, 10, 64) int64ID, _ := strconv.ParseInt(ctx.Message.ID, 10, 64)