Closed DirtyTCM closed 5 years ago
You need to mention the bot, e.g. @Tunneler ping
only ping seems to work nothing else
say, antispam about example none of em work besides ping and exit any idea why
I can think of two possible causes:
First double check that your id is correct in the auth.json file (owner). You can find out your ID by sending the following message to some Discord channel: \@DirtyTCM
(replace name with your Discord username) it should return an id which is something like 1234567890123 (all numbers).
Then, check that the command you are trying to use is enabled. To do this, open your server's config file, and make sure the command has enabled: true
Here's an example of ping:
"ping": {
"enabled": true,
"access": [
"owner"
]
},
Make sure the "access" part has owner in it, so that you (owner of the bot) are allowed to use the command.
If the config file is missing the entire command, you need to add it manually like above.
Here's an example for antispam settings:
"antispam": {
"enabled": true,
"settings": {
"warnings": true,
"punishment": "ban",
"punishmentRole": "",
"silentMode": false
}
}
Notice that middlewares, like antispam, have no commands to trigger them. They are active if the config exists and enabled: true
.
Commands and middlewares are two different things. Commands are actions that are triggered by channel commands, e.g. @Tunneler ping
and middlewares are something that affect all messages. Like antispam, where the antispam module reads all messages and analyzes them.
so how do i test if the anti-spam is working
{ "globalSettings": {}, "strings": { "default": { "keywords": [ "exit", "disconnect" ], "success_0": "ok, see you later!" }, "fi": { "keywords": [ "exit", "poistu" ], "success_0": "löydän itseni ulos." } } }
this is for exit like it doesnt say access owner or anything?
but yet it works?
okay i found it, but how can i make a command avaliable for everyone not just me
Set access
to all
. For example
"ping": {
"enabled": true,
"access": [
"all"
]
},
The antispam should be working if it is enabled for the guild, but you could test it by changing its punish
setting to warn
(so that you don't get kicked out of your server), and then asking someone to spam (to send messages with the same content).
Example:
2.40 PM SomeGuy this is spam
2.40 PM SomeGuy this is spam
2.40 PM SomeGuy this is spam
2.40 PM SomeGuy this is spam
2.40 PM SomeGuy this is spam
The bot should then react, if it has enough permissions. After you know it triggers, change the warn
back to what-ever you want.
If I remember correctly, the antispam ignores the owner, so you can either ask your friend or change the owner id temporarily.
Here's a full guild config that I've used in a quite big ChivalryGame Discord server:
{
"localization": "en",
"middlewares": {
"antispam": {
"enabled": true,
"settings": {
"punishment": [
"warn",
"ban"
],
"punishmentRole": "",
"cyclePunishments": true,
"silentMode": false
},
"excluded_authors": [
"106724343513387008"
]
}
},
"commands": {
"ping": {
"enabled": true,
"access": [
"owner"
]
},
"exit": {
"enabled": false,
"access": [
"owner"
]
},
"version": {
"enabled": true,
"access": [
"owner"
]
},
"reboot": {
"enabled": false,
"access": [
"owner"
]
},
"uptime": {
"enabled": true,
"access": [
"owner"
]
},
"chivalry": {
"enabled": true,
"access": [
"all"
]
}
}
}
In middlewares.antispam.settings.punishment the warn, ban
means that the bot will first warn the user and if the user doesn't obey, then ban.
You can exclude authors and roles (excluded_authors
or excluded_roles
), so they won't be warned/banned.
okay thank you, tbh ur like the only author who takes time to respond to people
whats punishment role? like mute?
i cant get anti spamm to work
PunishmentRole is a Discord role that you have on your server. It can be basically anything. Yes, it can mean mute too. PunishmentRole is only relevant if you have "role" set as a punishment.
You can get the id for example by mentioning it: \@myrole
, it should print out the role id.
Can you paste your server config to find out what's wrong with the anti spam? Have you compared it to the config I pasted above?
Make sure the bot has enough permissions to act. I usually give the "administrator" permission, which is basically the "allow anything" -permission.
it has it
Could you send your guild config, so I can try to replicate your issue? Also, have you altered antispam's settings in mw.antispam/middleware.json? (you shouldn't, before you get even just the default settings to work).
no i havent
{ "localization": "en", "middlewares": { "antispam": { "enabled": true, "settings": { "warnings": true, "punishment": "warn", "punishmentRole": "524890659119693834", "silentMode": false } } }, "commands": { "ping": { "enabled": true, "access": [ "everyone" ] }, "exit": { "enabled": true, "access": [ "owner" ] }, "reboot": { "enabled": true, "access": [ "owner" ] }, "about": { "enabled": true, "access": [ "everyone" ] } } }
Some notes:
I'm not sure whether any of those should actually prevent antispam from working, but they might. Try to use the config I provided above (copy & paste) and see if that works. If it does, you can then modify it step by step.
Hey, I just tried myself and I think I've found a solution and a bug. The bug is that the template that the bot creates is invalid. The "punishment" key in the config should actually be "punishments".
The following config worked:
{
"localization": "en",
"middlewares": {
"antispam": {
"enabled": true,
"settings": {
"punishments": [
"warn"
],
"punishmentRole": "",
"cyclePunishments": true,
"silentMode": false
}
}
},
"commands": {
"ping": {
"enabled": true,
"access": [
"all"
]
},
"exit": {
"enabled": true,
"access": [
"owner"
]
},
"reboot": {
"enabled": true,
"access": [
"owner"
]
},
"about": {
"enabled": true,
"access": [
"all"
]
}
}
}
Thank you for having patience for trying the bot out. I wouldn't have noticed the issue otherwise.
I just released a new version that fixes the invalid guild template. https://github.com/ahoys/tunnelerjs/archive/v.0.11.2.zip
You can now remove your guild folder (the one with 123123123123 name), and make the Tunneler to regenerate it on re-start.
anytime thank you so much for your help!
also is theyre a wway to exclude peope from antispam
Yes! You can exclude both roles and individual users. All you need is either the role id or client id.
"antispam": {
"enabled": true,
"settings": {
"punishments": [
"warn"
],
"punishmentRole": "",
"cyclePunishments": true,
"silentMode": false
},
"excluded_authors": ["1234567891234", "12329340221"],
"excluded_roles": ["98765432123"]
}
You can even exclude channels in the same way (excluded_channels).
Cant get the bot to execute any command but it config and auth is correct whats the prefix? i tried just typing like ping or reboot nothing happens