|
|
|
@ -92,7 +92,7 @@ func main() {
|
|
|
|
|
}
|
|
|
|
|
defer store.Close()
|
|
|
|
|
|
|
|
|
|
if err := initTracing(db); err != nil {
|
|
|
|
|
if err := initTracing(ctx, db); err != nil {
|
|
|
|
|
log.Fatal().Err(err).Msg("failed to initialize tracing")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -852,7 +852,7 @@ func registerHandlers(sess *discordgo.Session, handlers map[string]Handler) {
|
|
|
|
|
userId := i.Member.User.ID
|
|
|
|
|
log.Info().Ctx(ctx).Str("message_component", "schedule-response").Str("userid", userId).Msg("handling message component interaction")
|
|
|
|
|
|
|
|
|
|
if err := store.AddAbsence(context.TODO(), themis.NextMonday(), userId); err != nil {
|
|
|
|
|
if err := store.AddAbsence(ctx, themis.NextMonday(), userId); err != nil {
|
|
|
|
|
if err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
|
|
|
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
|
|
|
|
Data: &discordgo.InteractionResponseData{
|
|
|
|
@ -1019,8 +1019,8 @@ func parseCustomIDState(qs string) (url.Values, error) {
|
|
|
|
|
return v, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func initTracing(db *sql.DB) error {
|
|
|
|
|
res, err := resource.New(context.TODO(),
|
|
|
|
|
func initTracing(ctx context.Context, db *sql.DB) error {
|
|
|
|
|
res, err := resource.New(ctx,
|
|
|
|
|
resource.WithHost(),
|
|
|
|
|
resource.WithOS(),
|
|
|
|
|
resource.WithProcess(),
|
|
|
|
|