What exactly is a message channel? - message-channel

I've done my research. Basically, a message channel is the way an api can send a message to another api. But what, literally, is a message channel? Is it like a port? Or do you just implement it in your code?

Related

how to send automatically a message when we send in a Discord channel

In a Discord server I manage, there is a channel "Tutorials", where people can share tutorials for tools they might find useful.
The "rule" of this channel is that if we have a question about a tutorial, we need to answer inside a thread and not in the channel discussion (to avoid the important message being lost in history).
I updated the description of the channel, but this is not enough, because not everybody read it ;)
So I would like to set a way to make the user sure before they publish their message, for instance, my idea is when they try to send a message to the channel, a hidden message pops up telling "are you sure you want to do this ?" to recall the rule to the user.
Is there such a feature in Discord (or with a bot) ? Until now my researches were unsuccessful.

Discord Bot Trigger on Webhook Received

I am trying to pipe notifications from various online services into a Discord server using Webhooks. The problem is, discord doesn't render the message that is received by a webhook the way I need. It omits some information that I would like to display.
Is it possible to receive the raw JSON information from a webhook when it arrives, then process it and post into a channel?
My thinking was: I can create a new bot, then subscribe to some kind of webhook_message_received event and process it the way I want. Turns out, there's no such event (or I don't know where to look).
There's not much information online, so I would appreciate any advice.

Message counting in discord.js?

So i want to do a command, where if you enter, it sends a Dino emoji and a "sent by (User)" in a specific channel.
Now i need to know, is it possible to count every message in this channel and put it in the dino message?
Like the first dino ever would get
"dino #1, sent by #User"
I would not recommend using the number of messages in the channel for counting. Instead I would use some kind of data storage (JSON file, SQLite, SQL Database, etc) to store the count on the bot side. Fetching all the messages in a channel is a lot of requests to Discord and in some cases could be considered API abuse on Discord's end.

Send a single message on Discord JS (v12)

Im not able to send a single message from my bot using Discord JS as of v12.
I think before the update (v11) was able just by calling the channel.send('text here') but now I do not how to do it.
In detail: I want to send a message upon the bot connection and not only when someone sends a message; meaning that Im only able to send a message using the client.on('message', msg =>()
You can send messages anytime, as long as the bot is connected and ready.
The only reason why you say you "can't" send messages outside of the message event is because in the message event, you listen for a message event and respond to that message in the same channel.
You want to know how to send a message without a pre-existing message.
Go to the desired channel, right-click it, and click Copy ID. (If Developer Mode isn't on, turn it on in user settings.)
If you are using discord.js v12, use client.channels.cache.get('theChannelID').send('yourmessage'); or if you are using discord.js v11, delete the cache part.
Hope this helps.
If you want to message the same channel of the user's mess, try using message.channel.send(content)

DroneAPI and custom Mavlink message

I am new with DroneApi. I would to know how i can read a custom message using the DroneApi. I created a personal mavlink message that send me the value of a sensor. I would to know how i can read this new message using the DroneApi. Thank you.
Edit from comments: I followed this guide dev.ardupilot.com/wiki/apmcopter-code-overview/…. After being added my custom message my apm send each second the value of sensor by mavlink message. Now i would to read this message using a python script with DroneApi but i don't know how. Sorry for my english.
This is not currently supported - see Issue #169.
Commands are sent from DroneKit-Python using Vehicle.send_mavlink() (and the message_factory). There are a few examples of sending messages in the guide. For this to work the command has to be supported in the vehicle’s GCS_MAVLink.cpp file (otherwise the message will be recieved but the vehicle won't know what to do with it).
The problem is that you can send the message and the autopilot will respond. However in DroneKit there is no support yet for getting a specific response to the sent message back and handling it.
Your only option at the moment is to hook all messages and see if you can extract the one that is of interest to you. I have not tried this!

Resources