discord

Automatically make changes to a github file

家住魔仙堡 提交于 2021-02-18 18:13:04
问题 I’ve Made an app whith a whitelist, the withelist is on a github repo ( with just one file that is the withelist ), Each time that a user that downloads my app want to be allowed to use the app has to send me a message for be inserted in the white list. Right now this process is really slow and I want to speed it up but I’m trying to figure out how. I’m sesrching a way for Let the users send me a message Read the message ( with a bot or something that automate this process ) Make the bot add

Automatically make changes to a github file

痴心易碎 提交于 2021-02-18 18:11:44
问题 I’ve Made an app whith a whitelist, the withelist is on a github repo ( with just one file that is the withelist ), Each time that a user that downloads my app want to be allowed to use the app has to send me a message for be inserted in the white list. Right now this process is really slow and I want to speed it up but I’m trying to figure out how. I’m sesrching a way for Let the users send me a message Read the message ( with a bot or something that automate this process ) Make the bot add

List all guilds with multiple servers on a single embed

谁说我不能喝 提交于 2021-02-17 06:31:28
问题 This is my current code which shows the servers it is currently in. Which this does what I would like it to do, but it is not efficient and can be avoided instead of sending an embed message for each server it gets. @client.command() @commands.is_owner() async def list_guilds(ctx): servers = client.guilds for guild in servers: embed = discord.Embed(colour=0x7289DA) embed.set_footer(text=f"Guilds requested by {ctx.author}", icon_url=ctx.author.avatar_url) embed.add_field(name=(str(guild.name))

List all guilds with multiple servers on a single embed

最后都变了- 提交于 2021-02-17 06:31:08
问题 This is my current code which shows the servers it is currently in. Which this does what I would like it to do, but it is not efficient and can be avoided instead of sending an embed message for each server it gets. @client.command() @commands.is_owner() async def list_guilds(ctx): servers = client.guilds for guild in servers: embed = discord.Embed(colour=0x7289DA) embed.set_footer(text=f"Guilds requested by {ctx.author}", icon_url=ctx.author.avatar_url) embed.add_field(name=(str(guild.name))

discord.py How to add Mute command

允我心安 提交于 2021-02-16 15:19:24
问题 I'm making a discord bot and I really want to make a mute command to mute toxic users. This is the code I've currently done, this isn't the rewrite version. @bot.command(pass_context = True) async def mute(ctx, user_id, userName: discord.User): if ctx.message.author.server_permissions.administrator: user = ctx.message.author role = discord.utils.get(user.server.roles, name="Muted") await client.add_roles(user, role) else: embed=discord.Embed(title="Permission Denied.", description="You don't

discord.py How to add Mute command

孤街浪徒 提交于 2021-02-16 15:19:07
问题 I'm making a discord bot and I really want to make a mute command to mute toxic users. This is the code I've currently done, this isn't the rewrite version. @bot.command(pass_context = True) async def mute(ctx, user_id, userName: discord.User): if ctx.message.author.server_permissions.administrator: user = ctx.message.author role = discord.utils.get(user.server.roles, name="Muted") await client.add_roles(user, role) else: embed=discord.Embed(title="Permission Denied.", description="You don't

Getting None in message.guild.get_member_named(“member_name”)

女生的网名这么多〃 提交于 2021-02-15 07:45:47
问题 I'm getting NoneType in message.guild.get_member_named("Testing Account") and there is a person/account named Testing Account in the discord server. 回答1: First, make sure your bot has members intent enabled in the developer portal Enable intents in the code, and pass them in your bot/client with the intents kwarg. intents = discord.Intents.default() intents.members = True client = commands.Bot(command_prefix='!', intents=intents) I will update the question if the way you setup your bot is

Enable intents for discord.py bot

馋奶兔 提交于 2021-02-13 17:37:07
问题 Im making a discord bot, and every time it joins a new server, the bot sends me the server info and an invite. However, when I've tested this, it always shows one member which is itself. I have both presence and members intents enabled in the discord developer portal , but it still isn't working. I then changed some code to Guild.fetch_members() to which I received the error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Intents.members must be

Enable intents for discord.py bot

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-13 17:35:39
问题 Im making a discord bot, and every time it joins a new server, the bot sends me the server info and an invite. However, when I've tested this, it always shows one member which is itself. I have both presence and members intents enabled in the discord developer portal , but it still isn't working. I then changed some code to Guild.fetch_members() to which I received the error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Intents.members must be

Obtaining username from user id | discord.py

本小妞迷上赌 提交于 2021-02-13 17:07:56
问题 Well I have been working with databases for a while with discord in order to obtain major lists of user id's in a queue, although I am having problem's obtaining the user from user id as it returns none For Example members = list(privateduos[matchid]) user = discord.User(id=int(members[0])) await client.say("Say `test` " + str(user)) await client.wait_for_message(content="test", author=user) This is the Output The client.wait_for_message doesnt seem to detect the message author in the code as