Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c34f475084 | ||
|
|
1a7d9b824f |
@@ -288,7 +288,7 @@ func commentCommandFunc(ctx disgoman.Context, args []string) {
|
|||||||
discord_utils.SendErrorMessage(ctx, "Please include the ID of the request to update.", err)
|
discord_utils.SendErrorMessage(ctx, "Please include the ID of the request to update.", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
message := strings.Join(args[1:len(args)-1], " ")
|
message := strings.Join(args[1:len(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, "Sorry, there was an issue finding your user account", err)
|
discord_utils.SendErrorMessage(ctx, "Sorry, there was an issue finding your user account", err)
|
||||||
@@ -345,7 +345,9 @@ func commentCommandFunc(ctx disgoman.Context, args []string) {
|
|||||||
commentStrings = append(commentStrings, commentString)
|
commentStrings = append(commentStrings, commentString)
|
||||||
commentString = ""
|
commentString = ""
|
||||||
}
|
}
|
||||||
|
commentString += cs
|
||||||
}
|
}
|
||||||
|
commentStrings = append(commentStrings, commentString)
|
||||||
for _, c := range channels {
|
for _, c := range channels {
|
||||||
if c.Admin {
|
if c.Admin {
|
||||||
for _, s := range commentStrings {
|
for _, s := range commentStrings {
|
||||||
@@ -365,7 +367,7 @@ func commentCommandFunc(ctx disgoman.Context, args []string) {
|
|||||||
request.ID,
|
request.ID,
|
||||||
discord_utils.GetChannelName(ctx, ctx.Channel.ID),
|
discord_utils.GetChannelName(ctx, ctx.Channel.ID),
|
||||||
request.Content,
|
request.Content,
|
||||||
comment.Content,
|
message,
|
||||||
))
|
))
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -407,14 +409,16 @@ func viewCommandFunc(ctx disgoman.Context, args []string) {
|
|||||||
discord_utils.SendErrorMessage(ctx, "You are not authorized to view that request", nil)
|
discord_utils.SendErrorMessage(ctx, "You are not authorized to view that request", nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
comments, _ := services.RequestService.RequestComments(request)
|
comments, err := services.RequestService.RequestComments(request)
|
||||||
|
if err != nil {
|
||||||
|
discord_utils.SendErrorMessage(ctx, "There was an error getting the comments.", err)
|
||||||
|
}
|
||||||
var commentString string
|
var commentString string
|
||||||
var commentStrings []string
|
var commentStrings []string
|
||||||
commentString = fmt.Sprintf("Comment added:\n```md\n"+
|
commentString = fmt.Sprintf("```md\n"+
|
||||||
"< Request ID Requested By >\n"+
|
"< Request ID Requested By >\n"+
|
||||||
"< %-11d %23s >\n"+
|
"< %-11d %23s >\n"+
|
||||||
"%s\n\n"+
|
"%s\n\n"+
|
||||||
"Comments: Not Implemented Yet\n"+
|
|
||||||
"Requested At: %s\n"+
|
"Requested At: %s\n"+
|
||||||
"In: %s\n"+
|
"In: %s\n"+
|
||||||
"```",
|
"```",
|
||||||
@@ -425,10 +429,6 @@ func viewCommandFunc(ctx disgoman.Context, args []string) {
|
|||||||
discord_utils.GetChannelName(ctx, request.Channel.ID),
|
discord_utils.GetChannelName(ctx, request.Channel.ID),
|
||||||
)
|
)
|
||||||
for _, c := range comments {
|
for _, c := range comments {
|
||||||
if err != nil {
|
|
||||||
log.Println(err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
cs := fmt.Sprintf("```md\n%s\n- %s At %s\n```\n",
|
cs := fmt.Sprintf("```md\n%s\n- %s At %s\n```\n",
|
||||||
c.Content,
|
c.Content,
|
||||||
discord_utils.GetDisplayName(ctx, c.Author.ID),
|
discord_utils.GetDisplayName(ctx, c.Author.ID),
|
||||||
@@ -438,7 +438,9 @@ func viewCommandFunc(ctx disgoman.Context, args []string) {
|
|||||||
commentStrings = append(commentStrings, commentString)
|
commentStrings = append(commentStrings, commentString)
|
||||||
commentString = ""
|
commentString = ""
|
||||||
}
|
}
|
||||||
|
commentString += cs
|
||||||
}
|
}
|
||||||
|
commentStrings = append(commentStrings, commentString)
|
||||||
for _, c := range commentStrings {
|
for _, c := range commentStrings {
|
||||||
_, _ = ctx.Send(c)
|
_, _ = ctx.Send(c)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user