brandons209 / Red-bot-Cogs

Cog for Discord Red-Bot to do various things
GNU General Public License v3.0
13 stars 4 forks source link

Feature request: command to remove role based on inactivity #24

Closed AceAzzermeen closed 2 years ago

AceAzzermeen commented 2 years ago

A command that acts similarly to the purge command from your moreadmin cog. But instead of purging and therefore kicking people from the server, i would like it to just remove a certain role from the users.

Thanks for your work! I'm sorry if this is already implemented somewhere.

brandons209 commented 2 years ago

That shouldn't be too hard of a modification. I'll take a look at this soon.

brandons209 commented 2 years ago

Added in f9a21d4d772a787e4644553670587570661ea361

Use the [p]purgeset action command to change the action to removing the role. Let me know if you run into any issues!

AceAzzermeen commented 2 years ago

Thank you very much!

AceAzzermeen commented 2 years ago

I'm getting this error. I don't know which permission is supposedly missing. The purge command needs the permission to kick people to even run and I'm using reactionroles to assign roles so that shouldn't be the problem.

discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions,
    raise Forbidden(r, data),
    data = await self._state.http.invites_from(self.id),
  File "/data/venv/lib/python3.8/site-packages/discord/guild.py", line 1625, in invites,
  File "/data/venv/lib/python3.8/site-packages/discord/http.py", line 248, in request,
    invite = await guild.invites(),
  File "/data/cogs/CogManager/cogs/moreadmin/moreadmin.py", line 821, in purge,
    ret = await coro(*args, **kwargs),
Traceback (most recent call last):,
  File "/data/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
brandons209 commented 2 years ago

I'm getting this error. I don't know which permission is supposedly missing. The purge command needs the permission to kick people to even run and I'm using reactionroles to assign roles so that shouldn't be the problem.

discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions,
    raise Forbidden(r, data),
    data = await self._state.http.invites_from(self.id),
  File "/data/venv/lib/python3.8/site-packages/discord/guild.py", line 1625, in invites,
  File "/data/venv/lib/python3.8/site-packages/discord/http.py", line 248, in request,
    invite = await guild.invites(),
  File "/data/cogs/CogManager/cogs/moreadmin/moreadmin.py", line 821, in purge,
    ret = await coro(*args, **kwargs),
Traceback (most recent call last):,
  File "/data/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped

Sorry, ignore my previous comments. It is erroring trying to get the guild's invites. Make sure the bot has permission to manage invites. I'll add the permission check so the bot will notify you if it's missing that permission, I forgot that it order for the bot to get invites it's needs the right permission for it.