Code Monkey home page Code Monkey logo

Comments (6)

CruxCraft avatar CruxCraft commented on August 21, 2024

embed=discord.Embed(title="%%%PLAYER%%% has pinged the map!", description="%%%%%CONGFIG:world_name%%%%%", color=%%%%%CONFIG:color%%%%%)
embed.set_author(name="%%%%%CONFIG:server_name%%%%%", icon_url="%%%%%CONFIG:imageURL2.png%%%%%")
embed.set_thumbnail(url="%%%%%CONFIG:imageURL1a.png%%%%%")
embed.add_field(name="coordinates:", value="%%%COORDINATES_FROM_MAP%%%", inline=False)
embed.set_footer(text="%%Date&time_TIMESTAMP%%")
await ctx.send(embed=embed)

from valheim-discordconnector.

CruxCraft avatar CruxCraft commented on August 21, 2024

It would be pretty awesome to do death messages in a similar format =]

instead of embeds, you could also do code blocks which allows more colors to be used.
example:

```diff
!    Player123ABC    !
- CONFIG death message here about how your character died of dysentery -
---   timestamp   ---
*** coorditates:  ***
! ( -123, 77, -365 ) !

embeds look better, and mobile won't display colors anyway, but it does look nice on the desktop as a code block with multiple colors

from valheim-discordconnector.

CruxCraft avatar CruxCraft commented on August 21, 2024

Server Startup & Shutdown messages would probably also look good as embeds

Starting: color=0xff0000
Running: color=0x00ff00
Stopping: color=0xffff00

from valheim-discordconnector.

nwesterhausen avatar nwesterhausen commented on August 21, 2024

These colors are the highlight color next to the embed? Is this JSON from your first post what you suggest for the messages?

{
	"embed": {
		"footer": {
			"text": "%%Date&Time_TIMESTAMP%%"
		},
		"thumbnail": {
			"width": 810,
			"url": "%%%%%CONFIG:imageURL1a.png%%%%%",
			"proxy_url": "%%%%%CONFIG:imageURL1b.png%%%%%",
			"height": 810
		},
		"color": %%%%%CONFIG:color%%%%%,
		"type": "rich",
		"description": "%%%%%CONFIG:world_name%%%%%",
		"fields": [{
			"value": "%%%COORDINATES_FROM_MAP%%%",
			"name": "coordinates:",
			"inline": false
		}],
		"title": "%%PLAYER%% has pinged the map!",
		"author": {
			"name": "%%%%%CONFIG:server_name%%%%%",
			"icon_url": "%%%%%CONFIG:imageURL2.png%%%%%"
		}
	}
}

from valheim-discordconnector.

CruxCraft avatar CruxCraft commented on August 21, 2024

correct, that is the color of the embed. I also made an example with python code below that. I use the json in Discord with bots etc...

from valheim-discordconnector.

CruxCraft avatar CruxCraft commented on August 21, 2024

discovered i could just do

md whatever I want as my message

from with in the config & discord will display it as a code block so I can do formatting that way and looks nice for some of the messages =]

wish I could ping roles with the messages, but it doesnt seem to pass the @name/role through

from valheim-discordconnector.

Related Issues (20)

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.