Giter Site home page Giter Site logo

wasi-master / wm_bot Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 13.0 353 KB

A multipurpose discord bot with more than 220 commands

Home Page: https://wasi-master.github.io/wm_bot/

License: MIT License

HTML 1.19% CSS 0.84% Python 97.95% Batchfile 0.02%
discord-py discord-bot discord-py-rewrite discord python dpy discordpy postgresql asyncpg async

wm_bot's Introduction

Welcome

code size lines of code open issues closed issues license forks stars last commit contributors


WM Bot

With over 220 commands, this powerful bot can be tailored to meet your needs
Explore the commands »

View Demo · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Copying Code
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgements

About The Project

Around March 2020, I began learning Python. On July 7th, 2020, I started this project as a way of improving my knowledge of Python. I've written the code in this repository between then and now, so it may contain some bad practices. I would appreciate it if you reported any issues to me in my Discord: Wasi Master#6969 or opened a pull request. Please open an issue if you see any bugs or have any suggestions

Built With

Getting Started

This repository has a readme file for almost every folder so you can learn more about what is contained in that folder

To get a local copy up and running follow these simple steps.

Prerequisites

The following are the things you need to install in order to run the bot

Instructions

  1. Clone the repo

    git clone https://github.com/wasi-master/wm_bot.git
  2. Change directory to the cloned repo

    cd wm_bot/src
  3. Rename the folder config_example to config

    • Linux/MacOS:
    mv config_example config
    • Windows:
    ren config_example config
  4. Insert the bot token and database credentials into the config files. (Instructions are in each directory's readme.md file)

  5. Run the required commands in your database (either use this command or do it another way)

    psql <username> -h <hostname> -d <database_name> -f db_setup.sql

    And don't forget to replace <username> with your username. <hostname> with your database hostname and <database_name> with your database name.

  6. Install Required packages

    pip install -r requirements.txt
  7. Add the required emojis to your desired server using the following command

    • Windows:
    py emoji_adder
    • Linux:
    python emoji_adder
    • MacOS:
    python3 emoji_adder

    After that you can delete the emoji_adder folder or keep it if you ever want to add the emojis ever again

  8. Run the bot

    • Windows:
    py main.py
    • Linux:
    python main.py
    • MacOS:
    python3 main.py

Copying Code

Keep these things in mind if you want to copy any code from this repo

  • Read the [license] (license) and learn what it permits and disallows

  • To copy a whole command:

    1. Keep @commands.command if you are in a cog; otherwise, replace @commands.command with @bot.command or @client.command, according to what your bot instance is named
  • Whenever you see a function/class you are unsure about, you can click the name in the desktop version of github to find out where it is defined

Bad Practice, Code, or Code Style

Whenever you find anything that you believe is bad practice, code, or code style, let me know in my discord: Wasi Master#6969 or open an issue/pull request. Please open an issue if you see any bugs or have any suggestions

Usage

For a list of commands this bot has, please refer to the Documentation

Contributing

Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project

  2. Add or Change some cool code

  3. Format the code with black and isort

  4. Commit your Changes

  5. Push your code

  6. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Wasi Master

Acknowledgements

wm_bot's People

Contributors

restyled-commits avatar wasi-master avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wm_bot's Issues

Bot does not run ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection

Describe the bug
I'm getting this error

C:\Users\Shanzaraf_Okba\Downloads\Compressed\wm_bot-main\src>python main.py
Traceback (most recent call last):
  File "main.py", line 84, in <module>
    bot.loop.run_until_complete(create_db_pool(bot))
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:\Users\Shanzaraf_Okba\Downloads\Compressed\wm_bot-main\src\utils\bot.py", line 375, in create_db_pool
    bot.db = await asyncpg.create_pool(
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\pool.py", line 407, in _async__init__
    await self._initialize()
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\pool.py", line 435, in _initialize
    await first_ch.connect()
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\pool.py", line 127, in connect
    self._con = await self._pool._get_new_connection()
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\pool.py", line 477, in _get_new_connection
    con = await connection.connect(
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\connection.py", line 2045, in connect
    return await connect_utils._connect(
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\connect_utils.py", line 790, in _connect
    raise last_error
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\connect_utils.py", line 776, in _connect
    return await _connect_addr(
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\connect_utils.py", line 671, in _connect_addr
    return await __connect_addr(params, timeout, False, *args)
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\connect_utils.py", line 720, in __connect_addr
    tr, pr = await compat.wait_for(connector, timeout=timeout)
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\asyncpg\compat.py", line 66, in wait_for
    return await asyncio.wait_for(fut, timeout)
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\tasks.py", line 494, in wait_for
    return fut.result()
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1030, in create_connection
    raise exceptions[0]
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1010, in create_connection
    sock = await self._connect_sock(
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 924, in _connect_sock
    await self.sock_connect(sock, address)
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 702, in sock_connect
    return await self._proactor.connect(sock, address)
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 812, in _poll
    value = callback(transferred, key, ov)
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 599, in finish_connect
    ov.getresult()
ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection
Exception ignored in: <function ClientSession.__del__ at 0x000001DEBCCFCEE0>
Traceback (most recent call last):
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\aiohttp\client.py", line 337, in __del__
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1740, in call_exception_handler
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1475, in error
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1589, in _log
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1599, in handle
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1661, in callHandlers
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 954, in handle
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\rich\logging.py", line 150, in emit
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\rich\logging.py", line 196, in render
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\rich\_log_render.py", line 43, in __call__
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function ClientSession.__del__ at 0x000001DEBCCFCEE0>
Traceback (most recent call last):
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\aiohttp\client.py", line 337, in __del__
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1740, in call_exception_handler
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1475, in error
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1589, in _log
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1599, in handle
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1661, in callHandlers
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 954, in handle
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\rich\logging.py", line 150, in emit
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\rich\logging.py", line 196, in render
  File "C:\Users\Shanzaraf_Okba\AppData\Local\Programs\Python\Python38\lib\site-packages\rich\_log_render.py", line 43, in __call__
ImportError: sys.meta_path is None, Python is likely shutting down

To Reproduce
Steps to reproduce the behavior:

  1. Run the bot

Expected behavior
The bot should run

Screenshots
None

Desktop (please complete the following information):

  • OS: Windows
  • Browser: chrome
  • Version: 10

Additional context
None

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.