discord.py

discord.py - Send messages though console

余生颓废 提交于 2020-12-15 05:48:28
问题 ok, I wanted so I could send messages in an specific server and channel form the console. I seen on other post how to send messages on specific servers and channels but theyr from the discord app and not console. Can someone help me? I wanted so I type msg [server-id-here] [channel-name] [message] for example msg 493121776402825219 general hello Code I have but it has errors @bot.event async def on_ready(ch, *, msg): while msg: channel = bot.get_channel(ch) msg=input("Mensagem: ") if channel:

Push rejected, failed to compile Python app error Discord.py

送分小仙女□ 提交于 2020-12-15 05:27:19
问题 When I try to push my I get this error: C:\Users\emirs\PycharmProjects\discordmasterbot>git push heroku master Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Python app detected remote: -----> Installing python-3.6.10 remote: -----> Installing pip remote: -----> Installing SQLite3 remote: -----> Installing requirements with pip remote: Collecting git+https://github.com/Rapptz/discord.py@rewrite

How to make my bot forward DMs sent to it to a channel

﹥>﹥吖頭↗ 提交于 2020-12-15 05:26:24
问题 So, I've got a bot that can send a user a DM via a very simple command. All I do is "!DM @user message" and it sends them the message. However, people sometimes try responding to the bot in DMs with their questions, but the bot does nothing with that, and I cannot see their replies. Would there be a way for me to make it so that if a user sends a DM to the bot, it will forward their message to a certain channel in my server (Channel ID: 756830076544483339). If possible, please can someone

Discord.py-Rewrite Sending an Error message when there is an unknown command or other error

≡放荡痞女 提交于 2020-12-15 01:55:38
问题 I want to be able to send a message like await ctx.send("Error: Unknown command. Do -help for acceptable commands." or something like that (FYI, I'm not asking how to remove the Help is already a defined function or something like that.); But I don't know how to make an error message for something that isn't a command, Like if there is an error with a command like they didn't put any parameters then I'm able to make an error for that @command.error then i define it. But I'm not sure how to

Discord.py-Rewrite Sending an Error message when there is an unknown command or other error

試著忘記壹切 提交于 2020-12-15 01:55:26
问题 I want to be able to send a message like await ctx.send("Error: Unknown command. Do -help for acceptable commands." or something like that (FYI, I'm not asking how to remove the Help is already a defined function or something like that.); But I don't know how to make an error message for something that isn't a command, Like if there is an error with a command like they didn't put any parameters then I'm able to make an error for that @command.error then i define it. But I'm not sure how to

get_user(id) cant find user - returns None (self bot discord.py)

瘦欲@ 提交于 2020-12-13 18:33:13
问题 I am trying to DM myself using a self bot. I am trying to use the get_user() function in my code. bot = commands.Bot(command_prefix='', self_bot=True) counter = 0 userID = 695724603406024726 @bot.event async def dm(userID): print('Running Function') global counter if counter <= 0: print('Finding user.') counter += 1 user = bot.get_user(userID) print('user:',user) await user.send("Hello") print('message sent') return bot.loop.create_task(dm(userID)) bot.run(token, bot=False) Instead, I am

get_user(id) cant find user - returns None (self bot discord.py)

房东的猫 提交于 2020-12-13 18:31:24
问题 I am trying to DM myself using a self bot. I am trying to use the get_user() function in my code. bot = commands.Bot(command_prefix='', self_bot=True) counter = 0 userID = 695724603406024726 @bot.event async def dm(userID): print('Running Function') global counter if counter <= 0: print('Finding user.') counter += 1 user = bot.get_user(userID) print('user:',user) await user.send("Hello") print('message sent') return bot.loop.create_task(dm(userID)) bot.run(token, bot=False) Instead, I am

How to use discord python bot with proxy?

谁说胖子不能爱 提交于 2020-12-13 10:49:10
问题 Need to use discord bot with proxy (https or socks). For example, proxy is: 192.168.1.1:3125 and proxy autorisation is: proxy_login:proxy_pass I already try with this example: how to connect a discord bot through proxy but it can't. client = discord.Client(proxy=USER_PROXY, proxy_auth=aiohttp.BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS)) 回答1: You need to create a aiohttp.ProxyConnector and pass that as the connector to your Client : from aiohttp import ProxyConnector, BasicAuth basic_auth =

How do I async on_status from tweepy?

自古美人都是妖i 提交于 2020-12-13 06:30:13
问题 The error I'm getting is: RuntimeWarning: coroutine 'StdOutListener.on_status' was never awaited if self.on_status(status) is False: RuntimeWarning: Enable tracemalloc to get the object allocation traceback My stdOutListener looks like this: class StdOutListener(StreamListener): async def on_status(self, status): channel = await bot.get_channel(64970710814) await channel.send(status.text) I understand that I need to get on_status called async'd, but how do I do this? I've tried awaiting most

How do I async on_status from tweepy?

て烟熏妆下的殇ゞ 提交于 2020-12-13 06:29:40
问题 The error I'm getting is: RuntimeWarning: coroutine 'StdOutListener.on_status' was never awaited if self.on_status(status) is False: RuntimeWarning: Enable tracemalloc to get the object allocation traceback My stdOutListener looks like this: class StdOutListener(StreamListener): async def on_status(self, status): channel = await bot.get_channel(64970710814) await channel.send(status.text) I understand that I need to get on_status called async'd, but how do I do this? I've tried awaiting most