Hello everyone,
my english is very bad and for that i want to apologize first.
I hope you still understand me.
I want to intercept the ban reason about my bot.
But it always gets to me “null” in my DB or “n/a”.
I tried it with “/ban <username> <reason>” like this “/ban me_123_test this is a test”
My Bot is Mod and can Ban too. But don’t show my reason.
What is wrong ?
with friendly greetings from Germany
WLTN1
January 15, 2019, 9:36pm
2
When its a bot, from irc, command must start with “.”, not with “/”. Like “.ban me_123_test this is test”
Thank you for your reply … this dosnt work too … Same problem
EDIT: My Code -
var tmi = require(‘tmi.js’);
var options = {
options: {
debug: true
},
connection: {
cluster: “aws”,
reconnect: true
},
identity: {
username: “BOT_NAME”,
password: “oauth:MY_PW”
},
channels: [“test_user”]
};
var client = new tmi.client(options);
client.connect();
client.on(“ban”, function (channel, username, reason) {
console.log("User " + username + " banned in " + channel + ". (Reason: " + reason + “)”);
});
Output: User test_123 banned in test_user. (Reason: null)
Check out
Hi,
We’ve developed a small update for chat that you might be able to do things™ with if you so choose.
A user will attempt to send listen (with an oauth token) on a pubsub topic chat_moderator_actions.{user_id}.{room_id}
room_id is the user_id of the user that owns the room (in most cases the broadcaster’s user ID).
If that user is the broadcaster or a mod of the room they will receive messages containing a type of chat_login_moderation or chat_channel_moderation as well as some associated …
I went digging, it got moved from TMI to PubSub.
Which be why it’s not in the docs either.
There is a discussion thread on the matter from 2016, which basically says “use pubsub”
Hello BarryCarlyon,
thank you for your Reply… pubsub isn’t reachable at the link (404 - This is not the web page you are looking for.)
I try google with the query “pubsub” but was not successful.
I’m probably too stupid
PubSub is documented here:
PubSub Guide
The pubsub topic for moderation actions in the linked thread
Holy moly … very fast reaction … thank you … I will read it to myself and contact again if I can not get any further
The ban-reason
tag was a month or two ago removed from IRC and the reason is right now only available via the above-mentioned pubsub topic.
Hello, i have try to understand this “pubsub” but it’s for me a horror.
I want to understand it, but it does not work.
Can some one help me with a litle code for Ban Events?
Hmm… ok no one can help ?
Documentation is here:
PubSub Guide
PubSub is a industry stnadard communication method, so whichever programming language you prefer likely already has in implementation of PubSub as a library you can include.
I can’t just give you some code, without knowing a language preference or what you intended to then do with the collected information.
Yea, i have try to understand this but its for me a horror. I want to understand it, but it does not work. I try to code in NodeJS a Bot for my Channel how can listen " .on(“ban”, …) " and insert this banned user in a DB with original ban reason.
Well it sounds like your bot is already connected to TwitchChat over IRC.
So you will need to make a second connection to PubSub and then you will need to parse the response information pushed to you.
1 Like
system
Closed
February 18, 2019, 6:59pm
14
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.