Compare commits

..
5 Commits
Author SHA1 Message Date
Dustin Pianalto 83c41e2788 Add ftp credentials to db schema
CI / build (push) Has been cancelled
2021-02-22 23:10:57 -09:00
Dustin Pianalto 24aff1be72 Fix request message
CI / build (push) Has been cancelled
2021-02-22 22:19:25 -09:00
Dustin Pianalto b28beaba0c Fix request message 2021-02-22 22:18:59 -09:00
Dustin Pianalto 4f8aaff94a Fix request message 2021-02-22 22:17:18 -09:00
Dustin Pianalto a21e884bee Fix bug getting messages from db
CI / build (push) Has been cancelled
2021-02-22 22:12:07 -09:00
5 changed files with 19 additions and 3 deletions
+2 -2
View File
@@ -235,7 +235,7 @@ func listCommandFunc(ctx disgoman.Context, args []string) {
_, _ = ctx.Send(fmt.Sprintf("```md\n"+
"< Request ID Requested By >\n"+
"< %11s %-23s >\n"+
"< %-11d %23s >\n"+
"%s\n\n"+
"Comments: Not Implemented Yet\n"+
"Requested At: %s\n"+
@@ -249,5 +249,5 @@ func listCommandFunc(ctx disgoman.Context, args []string) {
))
}
_, _ = ctx.Send(fmt.Sprintf("There are currently %d open %s", len(requests), utils.PluralizeString("request", len(requests))))
_, _ = ctx.Send(fmt.Sprintf("```There %s currently %d open %s```", utils.PluralizeString("is", len(requests)), len(requests), utils.PluralizeString("request", len(requests))))
}
+3
View File
@@ -17,5 +17,8 @@ func PluralizeString(s string, i int) string {
if i == 1 {
return s
}
if s == "is" {
return "are"
}
return s + "s"
}
+2 -1
View File
@@ -5,6 +5,7 @@ import (
"log"
"github.com/dustinpianalto/geeksbot"
"github.com/lib/pq"
)
type messageService struct {
@@ -21,7 +22,7 @@ func (s messageService) Message(id string) (geeksbot.Message, error) {
WHERE m.id = $1`
row := s.db.QueryRow(queryString, id)
err := row.Scan(&m.ID, &m.CreatedAt, &m.ModifiedAt, &m.Content,
&m.PreviousContent, &channel_id, &author_id)
pq.Array(&m.PreviousContent), &channel_id, &author_id)
if err != nil {
return geeksbot.Message{}, err
}
@@ -0,0 +1,6 @@
BEGIN;
ALTER TABLE servers
DROP COLUMN ftp_port,
DROP COLUMN ftp_username,
DROP COLUMN ftp_password;
COMMIT;
@@ -0,0 +1,6 @@
BEGIN;
ALTER TABLE servers
ADD COLUMN ftp_port int4,
ADD COLUMN ftp_username varchar(200),
ADD COLUMN ftp_password varchar(200);
COMMIT;