Can anyone give a script specific to deleting messages in a specific channel from a specific role - discord

I am not personally very adept with knowing how to make script commands I wondering if anyone knew exactly how to make a command where I can get a bot to delete messages from a specific role if they happen to try to message in a sirten channel.
I tried to look around the options for the bot commands but I was lost in trying to figure it out

Related

Discord Auto Respond C#

I was wondering if anyone knew how to, if possible, make a simple bot that just responds to DM's sent to you. For example, if a friend DM's you, a bot responds with something like
"This is an automated response, hang in there and I'll soon respond."
Thanks in advance.
Previously answered in Auto-reply to direct messages
It's against Discord's TOS https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-
Hopefully in the future, they create some small feature that just gives a basic response. Though, it is understandable why they don't want this as it could cause a lot of spam DM's and fake "people" hopping into your DM's.

What defines a message as 'cached' in discord.js

As we all know, in the change from v11 to v12, cache was introduced, however I can't find anything online that explains exactly what it is as a concept. Can anyone explain how it works?
I have just taken a look at the D.JS source and thankfully it is heavily commented.
In many files it suggests that any message that is sent by a user, or any message mentioning a user caches said user. This works in the same way with guilds I believe.
This means that in order to find a user in a server using #get or other fetch methods, the user must have been mentioned, or typed a message.
BaseManager.js source file here
Client.js source file here
GuildManager.js sournce file here

Discord.py how would I add a command to clear out a certain amount of messages from a channel

I am looking to add a feature to my basic bot that will purge a number of messages in the channel
i.e
!purge 50
Will then delete 50 messages from the current channel.
You can do this really easily. Using purge, you can make this command.
By the way, please look at the docs before asking a question here. It would save everyone time.

Organise files for multiple mini-games for Discord bot

EDIT : (rewrite)
So, I'm doing a mini-games bot for my discord server. I have already done a bot with multiples features and it was organize like that :
- My main was handling my events. I was checking where my event was called and according to the channel, I will run my corresponding file.js.
- I have my main folder, with inside, one folder with my commands, one with my "handler" (like members counting, and other autonomous things), and the last one with my images.
Do you think it's correct, bad, and what can I improve ?
Can you send me your idea or your point on vue on that.
I try to make my code better each time I code, and organization is one of the thing I want to improve.
I hope it's a much more understandable.
Please read the handy DiscordJS Guide that covers this subject and maybe put a little more effort into your research next time: https://discordjs.guide/command-handling/#individual-command-files

How can I assign permissions with modules to a bot?

I want to setup a discord bot for a friend who mixes music. Using a existing bot I have been able to make it work. However only I can issue commands. Every time I try to define permission as suggested by the creator it returns with a error saying "Don't know user (the actual module permission route command)"
I have tried summarizing the permissions in a lot of ways. Also looked up a lot about .json modules and the syntax. In case the description that came with it was wrong but I was unable to find anything useful. Not experienced with writing a bot but I also looked into maybe making a .js config and put commands etc in that since .js might be easier for me to use. But It seems like a huge workaround for a syntax error. I am not sure what the parent module for commands is so I tried a number of lines based of reflector when reading the .dll.
The commands I gave to the bot following the suggested syntax (aParentModule.aChildModule.aCommand(arg1,arg2,arg3))
"#BOT permissions assign Admin Voice"
Reply:That doesn't look quite right, I will ignore these entries: Voice
I don't know this person.
I tells me the person issue a lot so I think I am not dividing the request properly there. Can't find out how to though.
#BOT permissions assign Yourcall ,voice,join
Reply: That doesn't look quite right, I will ignore these entries: ,voice,join
I don't know this person.
The bot I am using can be found on github for reference: https://github.com/BinkanSalaryman/Discord-Audio-Stream-Bot
Commands from config.json with the permission command
"text": {
"commands": {
"botAgent": "tomoko",
"permissions": {
"defaultPermissions": "!bot.stop() !guild.leave() help.commands(path) !permissions.assign(USER_OR_ROLE,PERMISSIONS) utils.ping(host)",
"userPermissions": {},
"rolePermissions": {}
}
The error I get from the bot "Tomoko.json"
"warning_badUser": "I don't know this person.",
I want to be able to give join and leave command to a specific role and not just the bot creator To do that the bot needs to stop seeing the commands as user names from what I can see based of the response messages.

Resources