GithubHelp home page GithubHelp logo

xackery / talkeq Goto Github PK

View Code? Open in Web Editor NEW
16.0 6.0 10.0 329 KB

Everquest (eqlog, telnet) <-> Chat (discord)

License: Apache License 2.0

Makefile 1.87% Go 98.13%
everquest discord eqlog telnet nats

talkeq's Issues

phpbb forum new posting support

SELECT username, forum_name, topic_title, post_text FROM phpbb_posts p INNER JOIN phpbb_users u ON p.poster_id = u.user_id INNER JOIN phpbb_topics t ON t.topic_id = p.topic_id INNER JOIN phpbb_forums f ON p.forum_id = f.forum_id WHERE post_id > 1;

send with webhook instead of bot for masked links

//telnet_msg.go

// replace the relevant line with
out += fmt.Sprintf("[%s](%s%d)", itemName, t.config.ItemURL, itemID)
// discord.go
// add to import block ...
	"net/http"
	"encoding/json"
//done import block ...

// Send sends a message to discord
func (t *Discord) Send(req request.DiscordSend) error {
	if !t.config.IsEnabled {
		return fmt.Errorf("not enabled")
	}

	if !t.isConnected {
		return fmt.Errorf("not connected")
	}

	webhookUrl := //<YOUR WEBHOOK URL>

	payload := DiscordWebhook{
		Content: req.Message,
	}

	jsonPayload, err := json.Marshal(payload)
	if err != nil {
		return fmt.Errorf("Failed to parse payload to JSON: %w", err)
	}

	resp, err := http.Post(webhookUrl, "application/json", bytes.NewBuffer(jsonPayload))
	if err != nil {
		return fmt.Errorf("Failed to send POST request: %w", err)
	}

	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		return fmt.Errorf("Received non-200 response: %d", resp.StatusCode)
	}

	return nil
}

My Go knowledge is absolute garbage and I have no idea how to integrate this correctly into your overall structure (my fork is getting more and more off the rails and is not-good-but-works-for-my-needs), so not gonna PR it. This does work, though. Maybe useful to you or someone else.

I'm going to try to work in reverse link handling (convert allaclone links to ingame links), and would love to contribute all of this but would need some handholding on getting it together correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.