gregzaal / auto-voice-channels Goto Github PK
View Code? Open in Web Editor NEWA Discord bot that automatically creates voice channels as they are needed.
License: MIT License
A Discord bot that automatically creates voice channels as they are needed.
License: MIT License
The ability to restrict roles that cannot use the bot would be helpful for banning users that have proven they can't handle freedom like using vc/name or vc/nick.
Could work similarily to how restricting commands work but if a user is in a role that is in the blacklist they are not allowed to do more than create a channel through the Auto Channel Creator(s).
Another option would be to be able to blacklist words/names from use in vc/nick or vc/name.
Just some thoughts I had about managing users. Hopefully, they haven't been suggested before, but at a quick glance, I didn't see it in the Discord or on here.
With other devs on board, it'd be good to send any admin logs (like errors and tickrate warnings) to a private channel in the support server, rather than just DM'ing the admin/me.
It'd also be good to allow approved devs (specified by a role in the support server) to run the various admin commands like whois
, settings
, log
, etc. to help in debugging.
This should be optional though and disabled by default, as people self-hosting the bot would probably just want to use DMs anyway.
Allow users to tell the bot to remember their current channel's settings (custom name, user limit, etc.) and use it for every new channel they make with the same primary channel.
Atm most of the patreon integration is still in the code, help docs, etc. This should all be removed/hidden and all commands and features should work unless patreon_info.py
is present.
when someone types vc/help the server get the response:
A FileNotFoundError error occured :(
Please ensure I have the correct permissions, check @avc Premium help help for the correct command usage, and then try again.
If that still doesn't help, try asking in the support server: https://discord.gg/qhMrz6u
and i am getting a private message with:
Server: 733421642910269480
FileNotFoundError with command help, params_str: ``
Traceback (most recent call last):
File "/discordbot-AVC/Auto-Voice-Channels/commands/init.py", line 164, in run
r = await cmd.execute(ctx, params) # Run command
File "/discordbot-AVC/Auto-Voice-Channels/commands/help_cmd.py", line 72, in execute
with open("docs.md", 'r', encoding='utf8') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'docs.md'
i already checked if the file/s are there and the file/s are there
i am hosting the bot on a private linux(ubuntu) server
and the bot have the permissions
Let the template expression check for the creator's user ID
Some servers have a verification process and use a different role for all their verified members. The bot could use this instead of @everyone when setting permissions for Private channels and Join channels.
Obviously we talked on discord about this, but I just want to keep a list here of the things that need to be done before (or shortly after) clustering the main bot:
stats
admin command, show guilds, users, channels, function timings & tick rates for all clusters (don't add them up, we want to see them individually so we can tell if one of them is dead). E.g:Servers: 570 · 482 · 565 (A:401 S:2) Users: 303194 · 298425 · 324812 Channels: 151 · 132 · 182
Response time: 0.15s Tick rate: 21.6s · 19.2 · 23.5
CPU: 19.4% MEM: 3.5GB (14%) DISK: 5.5GB (1%)
Last commit: fixed UIptime v2?
Lines of code: 5885
Up time: 0 Days, 14 Hours, 21 Minutes, 32 Seconds
Timings:
deletion_loop: 0.71 · 0.69 · 0.79
lingering_secondaries: 0.68 · 0.65 · 0.71
creation_loop: 0.67 · 0.65 · 0.71
main_loop: 0.41 · 0.45 · 0.41
check_dead: 0.25 · 0.25 · 0.21
dynamic_tickrate: 0.15 · 0.15 · 0.11
cleanup: 0.01 · 0.01 · 0.02
check_votekicks: 0.00 · 0.00 · 0.00
create_join_channels: 0.00 · 0.00 · 0.00
Currently it's possible to spam join/leave the Join channel of a primary channel, causing a new message to be sent to the creator each time until they block the user.
There should be some kind of rate limiting, or prevention of multiple request-to-join messages generated for the same user.
Seems sometimes the bot forgets about certain channels and doesnt delete them,
seems to need to have enough voice state event for it to update and clear these
Is it possible to change the digits from 1, 2, 3, 4, ...
to I, II, III, IV, ...
?
For example:
Optionally keep channels alive for a minute or two when everyone leaves, in case they DC'd and come back shortly. This saves them from having to redo any channel customization (e.g. name, permissions, attributes).
These could possibly be reused in the case of somebody spam creating channels, they simply get moved to their previously-made channel instead of forcing the bot to create a new channel.
Currently, +New Session is pushed below each new VC that is created.
I would like the VCs to be created below +New Session.
Is this doable?
From a user: "When the voice chat is locked - The vc Kick command doesn't seem to work after everyone votes to remove a user. I made the bot admin to see if permission was the issue but still didn't work after."
This can be used in the case where a #1
channel is set up permanently, so auto-numbered channels can start numbering from #2
.
Maybe someone know, how to change sqlite to mongodb database,
because when i hosted in heroku, when bot restart, old channel won't deleted, because cannot can't read the database before in heroku.
FileNotFoundError with command help, params_str: `` Traceback (most recent call last): File "C:\Users\matt\Desktop\vc channels\Auto-Voice-Channels\commands__init__.py", line 160, in run r = await cmd.execute(ctx, params) # Run command File "C:\Users\matt\Desktop\vc channels\Auto-Voice-Channels\commands\help_cmd.py", line 72, in execute with open("docs.md", 'r', encoding='utf8') as f: FileNotFoundError: [Errno 2] No such file or directory: 'docs.md'
The names of the text channels created for each voice channel (with vc/textchannels) should be customizable using the template system.
Frequently requested feature that some other bots already have.
Allow users to set vc/alwaysprivate
so that new channels are private from the start and they don't have to run vc/private
for every single channel.
Private channels generate significantly more API calls to discord so this would have to be a sapphire-only feature for the official bots, but it should be fine for private bots and self-hosters.
Let users customize at what point the @@game_name@@
template displays "General" instead of the names of multiple games being played.
Currently it's hard coded that more than 3 games = General.
how i can make this bot 24/7 online i use pm2 is not work and i use Screen and tmux is not work can you help me to do this
Let people use the template system to dynamically rename other existing channels by running some command like vc/track 688036269061570568
or vc/track this channel
, and then vc/name blah blah blah
as usual.
When the channel is empty its name can revert back to the original name unchanged by the bot.
Tracking channels permanently could add significant load to the bot if everyone does this, since they have to be watched even when the channels are empty, so it would have to be a Gold+ feature.
It's probably common that servers have a mixture of permanent voice channels and channels managed by the bot. It'd probably be nice if the same commands could be used for all of them, though this should be optional and off by default to avoid users screwing up servers.
This would mean rewriting a bunch of the logic that checks if commands are valid (some can only be used when in a voice channel), and care should be taken to ensure that primary channels (which for this bot are essentially just buttons and not meant to be used as voice channels) are unaffected.
For some reason sometimes some of the loops just decide to crash, possibly without an error message or any indication.
It'd be nice if each loop tracked the last time that it ran (using a cfg
variable) and then have another loop that watches these timestamps, and if any are unusually old (several minutes, e.g. twice the loop interval) notifies the admin that that loop has crashed.
Use the guild setting as the default value to prevent breaking existing setups.
do_create_text_channel = primary['text_channels'] if 'text_channels' in primary else (settings['text_channels'] if 'text_channels' in settings else False)```
Certain commands (e.g. toggleposition
) only affect new channels and not existing ones - or sometimes channel order gets magically screwed up when multiple people are creating channels simultaneously...
It'd be nice if there were a command to fix all channel positioning on demand.
Option to group secondary channels together above/below multiple primary channels so that the primary channels are easier to find in one place.
Discord will remove servers from the Discovery list if a blacklisted word appears in a channel name.
Some games have these words in their titles, and can trigger a community server to be auto-removed.
While I haven't seen a public list provided by Discord, you can test this yourself by naming a channel an "offensive" word.
An example word that triggers the auto-removal is "Genocide" ( https://en.wikipedia.org/wiki/Genocide_(online_game) ) - others are extremely inappropriate for posting to Github.
The bot should have a word blacklist for channel titles that ships by default that includes words that disqualifies a server from Discovery. The bot should just replace the blacklisted word in the channel title with a '?' or other appropriate censorship method.
The help command is massive. It's 5 separate messages with embeds and that's almost enough to be rate limited when running just that one command.
Rather just show some basic info and link to further docs in the wiki.
Same for the template command.
Would be nice to show how long the bot has been alive as an indication of stability.
This could either be time since startup, or time since last connection (on_shard_ready
).
Or both ¯\_(ツ)_/¯.
Right now the singular/plural syntax is not nestable and causes unexpected behavior when you try to nest them. This should be fairly straightforward to fix by checking how the expressions/random word selection code works, as those are already nestable.
Right now all vc/public
does is set connect=True
for the @everyone role. This is bad because it might not be True for the primary channel - server owners might have restricted only certain roles/people to be allowed to connect by default.
vc/public
should do the same permission copies as it does when creating a new channel: copying them from the primary channel, or whatever inheritpermissions
is set to.
Using a .env file as opposed to a .json file is more secure.
Bot refuses to kick people by voting.
Nothing happens, no matter how much time has passed and no matter how many people put the state emoji.
screen
Seems the main bot running on 1.3.x+ has issues toggling the channel position after having multiple issues raised about this.
It's become apparent that many of the bots users don't speak good English, or any at all. A lot of the questions in the support server are due to this.
It's be great if anyone could volunteer to translate some of the command responses and help text. Right now there is no system in place to facilitate these translations, but respond here if you are interested in helping, or you know of a good way to implement multilingual documentation.
i don't know why name command isn't working on my end.
the bot is adding reaction but not changing the vc name
Can anyone make this to a redbot cog?
I'm running a bot on my own server using redbot, is it possible to use this alongside redbot on one bot?
https://github.com/gregzaal/Auto-Voice-Channels/blob/master/functions.py#L938
usd
scaps
bold
italic
bolditalic
script
boldscript
fraktur
boldfraktur
double
sans
boldsans
italicsans
bolditalicsans
mono
Maybe this should be a separate vc/font
command instead of string manipulators, since only one should be used at a time and string manipulators can be stacked.
If I change the name of the primary channel from "+ New Session" to anything else then the secondary channel will be made at the bottom of the category ignoring the vc/toggleposition command.
I suspect a big cause of the performance issue is hard drive read/writes when channels are created/deleted or the creator changes.
This is all blocking code and should be done instead with an asynchronous database.
Expression variable to detect whether or not the channel is private.
Since discord nerfed their rate limit for channel renaming down to only twice every 10 minutes, it's no longer acceptable to just check each channel in a loop every X seconds/minutes if they need to be renamed.
Instead, we need a system without loops that catches various events (user activity changes, users joining the channel...) depending on the template used (e.g. only catch user activity changes if @@game_name@@
is used in the template) and queues up a rename for the channel.
Then there could be a queue handler that decides if it's safe to rename the channel (to avoid hitting the rate limit) and sends the actual request when it's safe to do so.
For bonus points, if a user uses the vc/name
command and the queue handler decides it's not safe to rename the channel yet, it could return a callback so the bot can respond to the user and tell them exactly how soon the channel will be renamed. Currently with the loop only running once every 10 minutes, the vc/name
command can have no effect for 10 minutes, with no feedback to the user to explain why.
I'm using my own hosted bot. Followed the directions on it. Everything works. Except it doesn't update the name of the channel. So if I join in a channel, it counts 1 person in it, no matter how many people join. It only shows the game that people were playing on the name, when they joined, but not if it changes.
Any idea where I can start looking for troubleshooting? Or what information I can provide you for help?
Thanks.
There's probably a good reason why the command module exists, I just didn't know about it until I'd already re-invented the wheel.
Things to keep in mind:
restrict
command can be used to restrict usage of other commands to certain roles.reload_modules
function/admin command to update them without restarting the bot.The names of the join channels created for each private channel should be customizable using the template system.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.