Questions tagged [asyncpraw]

Async PRAW, an abbreviation for “Asynchronous Python Reddit API Wrapper”, is a Python package that allows for simple access to ’s API. Async PRAW aims to be easy to use and internally follows all of Reddit’s API rules. With Async PRAW there’s no need to introduce sleep calls in your code. Give your client an appropriate user agent and you’re set.

17 questions
3
votes
1 answer

RuntimeError: Event loop is closed in asyncpraw python

I am trying to use the asyncpraw library, but I get RuntimeError: Event loop is closed. This is my code and traceback. Code import asyncio import asyncpraw async def main(): reddit = asyncpraw.Reddit('praw_ini_name') print('User is', await…
python_user
  • 5,375
  • 2
  • 13
  • 32
1
vote
0 answers

Asyncpraw unclosed client session withing giving an client session object in logs

I was able to implement asyncpraw and it works pretty well and faster but the issue I am facing right now is that I get en error in the logs. The error I get is I was able to implement asyncpraw and it works pretty well and faster but the issue I am…
1
vote
0 answers

Telegram Bot UNCLOSED CLIENT

Basically I was doing a small bot for telegram to send pictures from a subreddit, but it gives me an error which I don't know how to fix. Everything where it says (not shown) is something I can't show due to it being something with which anyone…
0
votes
1 answer

Asyncpraw basic reddit API example throws error right after execution

I just got into trying to make a bot using the AsyncPraw Reddit API wrapper. I copy-pasted the code example in the documentation and i can't get it to run without getting atleast a warning. by trying to execute this code: import asyncpraw import…
Patientes
  • 113
  • 1
  • 1
  • 7
0
votes
0 answers

Error in scraping reddit using asyncpraw and asyncio. Asking an asyncio.Future, a coroutine or an awaitable

I'm having trouble with my code here when searching for popular or trending subreddits # Set up Reddit API credentials client_id = reddit_client_id client_secret = reddit_client_secret user_agent = reddit_client_user_agent #scrape reddit…
0
votes
0 answers

I am getting an error of unknown interaction in nextcord

My code: import nextcord from nextcord.ext import commands from nextcord import Interaction, VoiceChannel, Member from nextcord.utils import get from dotenv import load_dotenv import os import asyncpraw import random import…
Nishil Sheth
  • 155
  • 1
  • 10
0
votes
0 answers

401 HTTP response while using asyncpraw

I need to extract data from reddit (subreddits, posts, comments etc). I'm using asyncpraw and following the documentation: pip install asyncpraw import asyncpraw reddit = asyncpraw.Reddit( client_id="my client id", client_secret="my client…
0
votes
0 answers

Discord.py: Reddit API Request takes a long time

I am currently programming a Discord Bot using Discord.py, aiohttp and asyncpraw to work with Reddit API requests. My problem is that every request takes a long time to respond. Do you have any solutions how to improve speed of my code / API…
Popeye
  • 11
  • 2
0
votes
0 answers

SyntaxError: 'await' outside function with `async for`

I'm not very good with API and async whatnot but this piece of code is literally taken right from the asyncpraw documentation, yet it's producing an error. I'd appreciate it if anyone can help. import asyncpraw reddit = asyncpraw.Reddit( …
0
votes
1 answer

How to get all image urls from reddit post where multiple asyncpraw python?

I can't find how to get them, so i hope someone will help subreddit = await reddit.subreddit(next_subred) submission = subreddit.new(limit=1) item = await submission.__anext__() image = item.url work only if image one
0
votes
1 answer

Discord.py - ASYNCPRAW optimization

Is there any way to optimize this code? It just takes tooo long to response: @bot.command() async def picture(ctx, name=None): pic_submission = await reddit.subreddit("Genshin_Impact") if name is None: submission = random.choice([i…
SanyGame
  • 1
  • 1
0
votes
1 answer

Unclosed client session

I'm trying to make command to discord bot ,that takes list from this script and send one random from them.I started program in Python about month ago soo it's actually pretty hard for me. Problem is that when i run this script appears error :…
Vipek
  • 13
  • 3
0
votes
1 answer

How to use cronjobs to run a python script on a webserver thats on the cloud?

I am currently trying to create a Discord bot (with Discord.py) that is able to search through Reddit every few hours to see if there is anything new that has been posted in a specific subreddit. Currently, I have a way to scrape Reddit for this…
ABhatia
  • 3
  • 2
0
votes
1 answer

How to make a meme command using asyncpraw in discord.py?

How can i make a meme command using ASYNCPRAW? i looked in the internet but i didn't find any solution, because there is not much about asyncpraw in general.
elixss
  • 55
  • 5
0
votes
1 answer

How to loop an async function with parameters in discord.py?

I have an async function that I want to loop infinitely. @client.command() async def cat(ctx): tempurl = "b" subreddit = await reddit.subreddit("cats") allSubmissions = [] new = subreddit.new(limit = 1) async for…
Xanthis
  • 1
  • 1
  • 4
1
2