fuck chatgpt

This commit is contained in:
aaron 2024-11-05 07:27:51 -08:00
parent 4bc38ffb7b
commit 304923a482
12 changed files with 0 additions and 33 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,42 +1,9 @@
package main
import (
"context"
"encoding/json"
"strings"
"github.com/mattermost/mattermost/server/public/model"
"github.com/pkg/errors"
)
// HandleProcessList handles the incoming process list from the desktop app.
func (p *Plugin) HandleProcessList(ctx context.Context, requestData []byte) error {
var request struct {
ProcessList string `json:"processList"`
UserID string `json:"userID"`
}
if err := json.Unmarshal(requestData, &request); err != nil {
return errors.New("invalid request payload")
}
game := ""
for knownGame := range knownGames {
if strings.Contains(request.ProcessList, knownGame) {
game = knownGame
break
}
}
if game != "" {
if err := p.SetUserGameStatus(request.UserID, game); err != nil {
return errors.New("failed to update user status: " + err.Error())
}
}
return nil
}
// InitRoutes initializes any needed routes or commands for the plugin.
func InitRoutes(p *Plugin) {
// Register the command that the user will call to set their game.