I want to know how to get the most recent message sent in a channel of a discord server with discord webhooks in python? I have not tried anything yet. Source: Python..
Category : discord
I have looked through several similar threads however after trying everything I could find I have gotten to a point where I do not have any error messages but nothing is happening. The events are not the problem, the command is not working as supposed. I wanted to implement the bot joining a voice channel ..
I’m wondering how to send a message to a specific channel in discord. Here’s the code I have so far: import discord client = discord.Client() @client.event async def on_ready(): channel = client.get_channel(channelID) await channel.send(‘hello’) client.run("—") I want to have is so you run a command like !channel, and for that specific guild, the channel ID ..
I’m trying to get the last message from X GUILD and Y CHANNEL that arrives in discord only to read it and print it into Phyton console but it’s so confusing, there are tokens for bots and also the official API and it’s a bit difficult for me to get through all it alone with ..
Okay so I am designing a Discord bot in Python, am pretty new though. I was trying to get it to join a voice channel so I did some research and came up with the following, I cut out the irrelevant part of the bot so this is just the part with the voice connection. ..
Hello guys im trying to write a code that gives me the discord server owner but its giving Me ‘None’ import discord client = discord.Client() TOKEN = ‘token’ @client.event async def on_message(message): if message.content.find("getowner") != -1: await message.channel.send(str(message.guild.owner)) client.run(TOKEN) Can someone please help me with this bot thanks!! I want to get the discord servers ..
so first of all, I am pretty new to Python and Bot programming. What I am trying to achieve is, to send a private message to everyone that has newly connected to my discord server. I have looked through the API documentation but was unable to find anything that checks for new connections. I thought ..
When I type ?settings hoist or ?settings hoist yes/no it sends back Incorrect value, type ?settings for more information. It’s not passing the value of hoist. how do I make this work? @commands.command() @commands.has_permissions(administrator=True) async def settings(self, ctx, setting=None, value=None): if setting is None: await ctx.send(‘none’) elif setting == ‘hoist’: await self.hoist(ctx,value) else: embed = ..
I wanna remove all roles a member has when its if game_after How can I do for role in member.roles: await member.remove_roles(role) here? I get 404 Not Found (error code: 10011): Unknown Role when I do for role in member.roles: await member.remove_roles(role) @commands.Cog.listener() async def on_member_update(self, before, after): game_after = [i for i in after.activities ..
My goal is to create you a channel with your namewhen you react to one specific emoji on one specific message, . i’ve actually tried that: @bot.event async def on_raw_reaction_add(payload): message_id = payload.message_id if message_id == **************: guild = bot.get_guild(payload.guild_id) user = bot.get_user(payload.user_id) print(is_user(payload.user_id)) if is_user(payload.user_id): return chan = await guild.create_text_channel(user.name) await chan.set_permissions(user, read_messages=True,send_messages=True) new_user(payload.user_id,chan.id) ..
Recent Comments