This Discord bot is designed to fetch new arXiv papers based on specified interests and share them in a designated channel. It utilizes the arXiv API to search for papers matching provided categories, authors, and keywords, then presents the results in the Discord server.
To run this bot, ensure the requirements are met by installing it:
pip install .
-
Clone this repository to your local machine.
-
Obtain a Discord bot token from the Discord Developer Portal.
-
Create a
.env
file in the project directory and add your Discord bot token:DISCORD_TOKEN=your_discord_bot_token_here GUILD_ID=your_discord_guild_id_here CHANNEL_ID=your_discord_channel_id_here
-
Customize the bot's interests by modifying the
interests
dictionary in the script. -
Adjust other configurations like
MAX_NUMBER_OF_RESULTS
andTIME
if needed. -
Invite the bot to your Discord server using the OAuth2 URL generated from the Discord Developer Portal.
Run the bot using:
python -m arxivbot
Once the bot is set up and running, you can use the following commands:
!fetch
: Fetches arXiv for new articles and prints them in the specified channel.!abstract <num>
: Prints the abstract of a fetched paper based on its number.!query
: Returns the registered queries.!add_queries <cat> <keywords>
: Adds keywords to the specified category (categories, authors, keywords).!remove_queries <keyword>
: Removes a parameter from the queries.!clear_query
: Removes all queries.!max_results <num>
: Changes the maximum number of results to fetch.
- The bot fetches papers daily at the specified time (
TIME
variable in the script). - Papers fetched will be from the current day if
today
is set to True. - Make sure to set up appropriate permissions for the bot in your Discord server.