discord.py

How to make a weather command using discord.py v1.4.1

半腔热情 提交于 2020-12-30 02:38:27
问题 In case you would like to make a weather command using discord.py and have a cool addition to your bot, I got you covered, I have answered below on how to create a weather command in discord.py. 回答1: We will be making a command which will work like this - Starting off, we are going to be using openweahtermap API, which requires an API key, you can get one for free by simple logging in to their website. Once you have got the API key, you are all good to go. The second step will be to start

How to make a weather command using discord.py v1.4.1

老子叫甜甜 提交于 2020-12-30 02:38:06
问题 In case you would like to make a weather command using discord.py and have a cool addition to your bot, I got you covered, I have answered below on how to create a weather command in discord.py. 回答1: We will be making a command which will work like this - Starting off, we are going to be using openweahtermap API, which requires an API key, you can get one for free by simple logging in to their website. Once you have got the API key, you are all good to go. The second step will be to start

Discord.py on_message isnt a @bot.event?

痞子三分冷 提交于 2020-12-27 06:53:31
问题 import datetime import discord from discord import message, ActivityType from discord.ext import commands import asyncio intents = discord.Intents().all() bot = commands.Bot(command_prefix='.', intents=intents) guild = 'SwiftNetwork' time = datetime.date.today() badword = ['bw', 'bw1', 'bw2', 'bw3'] @bot.event async def on_ready(): print('Wir sind als {1} auf {0} eingeloggt Vers: {2}'.format(guild, bot.user.name, discord.__version__)) channel = bot.get_channel(id=697572461629407305) await

Discord.py rewrite get_member() function returning None for all users except bot

谁说我不能喝 提交于 2020-12-27 06:14:27
问题 I made a stupid discord bot a few months ago to change my friends name every minute, but I updated it today and now the get_member function is returning none. @client.event async def on_ready(): print('bot is ready!') status = discord.Activity(name="Sam be a loser", type=discord.ActivityType.watching) await client.change_presence(activity=status) name_change.start() @tasks.loop(minutes=1) async def name_change(): server = client.get_guild(id=584112137132048387) user = server.get_member

Discord.py rewrite get_member() function returning None for all users except bot

不想你离开。 提交于 2020-12-27 06:11:50
问题 I made a stupid discord bot a few months ago to change my friends name every minute, but I updated it today and now the get_member function is returning none. @client.event async def on_ready(): print('bot is ready!') status = discord.Activity(name="Sam be a loser", type=discord.ActivityType.watching) await client.change_presence(activity=status) name_change.start() @tasks.loop(minutes=1) async def name_change(): server = client.get_guild(id=584112137132048387) user = server.get_member

Discord.py rewrite get_member() function returning None for all users except bot

狂风中的少年 提交于 2020-12-27 06:11:13
问题 I made a stupid discord bot a few months ago to change my friends name every minute, but I updated it today and now the get_member function is returning none. @client.event async def on_ready(): print('bot is ready!') status = discord.Activity(name="Sam be a loser", type=discord.ActivityType.watching) await client.change_presence(activity=status) name_change.start() @tasks.loop(minutes=1) async def name_change(): server = client.get_guild(id=584112137132048387) user = server.get_member

How do I make my Python discord bot give roles on join?

怎甘沉沦 提交于 2020-12-27 05:54:14
问题 I have a bot that I'm trying to make better. It's called moderator bot and I'm working on adding new commands. I just can't find the code anywhere. How do I get moderator bot to give user roles when they join the server. And how do I make it configurable by the server owner so that the bot can be used over different servers? I also want it to DM the owner commands so they can see it along with only owner-set roles being able to access that command. It sounds advanced and probably is, but can

How do I make my Python discord bot give roles on join?

浪尽此生 提交于 2020-12-27 05:51:42
问题 I have a bot that I'm trying to make better. It's called moderator bot and I'm working on adding new commands. I just can't find the code anywhere. How do I get moderator bot to give user roles when they join the server. And how do I make it configurable by the server owner so that the bot can be used over different servers? I also want it to DM the owner commands so they can see it along with only owner-set roles being able to access that command. It sounds advanced and probably is, but can

Discord Bot can only see itself and no other users in guild

徘徊边缘 提交于 2020-12-26 09:23:46
问题 I have recently been following this tutorial to get myself started with Discord's API. Unfortunately, when I got the part about printing all the users in the guild I hit a wall. When I try to print all users' names it only prints the name of the bot and nothing else . For reference, there are six total users in the guild. The bot has Administrator privileges . import os import discord TOKEN = os.environ.get('TOKEN') client = discord.Client() @client.event async def on_ready(): for guild in

Discord Bot can only see itself and no other users in guild

…衆ロ難τιáo~ 提交于 2020-12-26 09:23:21
问题 I have recently been following this tutorial to get myself started with Discord's API. Unfortunately, when I got the part about printing all the users in the guild I hit a wall. When I try to print all users' names it only prints the name of the bot and nothing else . For reference, there are six total users in the guild. The bot has Administrator privileges . import os import discord TOKEN = os.environ.get('TOKEN') client = discord.Client() @client.event async def on_ready(): for guild in