#Banning
1 messages · Page 1 of 1 (latest)
impl.rest.RESTClientImpl.ban_user
impl.rest.RESTClientImpl.unban_user
impl.rest.RESTClientImpl.ban_member
impl.rest.RESTClientImpl.kick_user
impl.rest.RESTClientImpl.unban_member
impl.rest.RESTClientImpl.fetch_user
impl.rest.RESTClientImpl.close
impl.rest.RESTClientImpl.edit_my_user
impl.rest.RESTClientImpl.start
impl.rest.RESTClientImpl.fetch_bans
First one
You can use the function to ban a user
And how to take in the user in a slash command and setup permissions you can find in lightbulbs guide
Thanks
So would i write it as:
import hikari
plugin3 = lightbulb.Plugin('ban')
@plugin3.listener(hikari.GuildMessageCreateEvent)
async def print_messages(event):
print(event.content)
@plugin3.command
@lightbulb.command('ban', 'shhhh')
@lightbulb.option("Reason", "ban Reason")
@lightbulb.implements(lightbulb.SlashCommand)
async ban_user(guild, user, *, delete_message_days=30, delete_message_seconds=undefined.UNDEFINED, reason=ctx.options.Reason)
def load(bot):
bot.add_plugin(plugin3)```?
Bu thx for helping above
Nope
Sorry, this has confused me. Can you explain
The docs specify what arguments the function takes in
To call the function, you can use:
await ctx.bot.rest.ban_user(ctx.guild_id, ...)
# ... Implying any other args you want to pass in
Using slash how would i take the User in? @lightbulb.option
Idk if when you are online you can help:
import hikari
plugin3 = lightbulb.Plugin('ban')
@plugin3.listener(hikari.GuildMessageCreateEvent)
async def print_messages(event):
print(event.content)
@plugin3.command
@lightbulb.option('user', 'user to ban')
@lightbulb.command('ban', 'shhhh')
@lightbulb.implements(lightbulb.SlashCommand)
async def ban(ctx):
await ctx.bot.rest.ban_user(ctx.guild_id, ctx.user == ctx.option.user)
def load(bot):
bot.add_plugin(plugin3)```
Sorry i don't know much im new to python and this.
import lightbulb
import hikari
plugin3 = lightbulb.Plugin('ban')
@plugin3.listener(hikari.GuildMessageCreateEvent)
async def print_messages(event):
print(event.content)
@plugin3.command
@lightbulb.option('user', 'user to ban', type=hikari.User)
@lightbulb.command('ban', 'shhhh')
@lightbulb.implements(lightbulb.SlashCommand)
async def ban(ctx):
await ctx.bot.rest.ban_user(ctx.guild_id, ctx.option.user)
def load(bot):
bot.add_plugin(plugin3)
For kick do i jsut change the ban to kick?
And im getting this