All Projects → Carberra → Carberretta

Carberra / Carberretta

Licence: BSD-3-Clause license
A Discord bot designed for the Carberra Tutorials Discord server.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Carberretta

spring-boot-examples
本仓库为《Spring Boot 系列文章》代码仓库,欢迎点赞、收藏。
Stars: ✭ 52 (+205.88%)
Mutual labels:  hikari
Hikari
simple discord.js music bot using distube 🎵 | Stage channel support!
Stars: ✭ 19 (+11.76%)
Mutual labels:  hikari
hikari
A Discord API wrapper for Python and asyncio built on good intentions.
Stars: ✭ 631 (+3611.76%)
Mutual labels:  hikari
multitenant
Multi-Tenant Spring Boot Application with separate databases using Hibernate and H2.
Stars: ✭ 15 (-11.76%)
Mutual labels:  hikari
hikari-intro
An introduction to hikari, complete with different examples for different command handlers.
Stars: ✭ 17 (+0%)
Mutual labels:  hikari
hikari-lightbulb
The official unofficial command handler for the Python discord API wrapper library, Hikari.
Stars: ✭ 152 (+794.12%)
Mutual labels:  hikari

Carberretta

This branch is for the v2 release of Carberretta.

You will need Python 3.10 or higher to run Carberretta.

Running the bot

Installing dependencies

# To run the bot:
pip install -r requirements.txt
python -m carberretta

Use CTRL+C to shut the bot down.

Contributing

Currently, only ports of cogs from v1 are being accepted.

Setting up

pip install -r requirements-dev.txt

Contact Carberra to obtain the .env file required.

Checks

  • Run nox to run various checks to make sure everything is okay. If all pipelines pass, push the changes up. If not, you'll need to make changes until they all pass.
  • If you're unsure how to make a test pass, push the changes, and ask another contributor for help.
  • If the safety check fails, raise a separate issue.

Porting v1 cogs

When porting a cog OPEN A DRAFT PR ONCE YOU'VE MADE YOUR FIRST COMMIT. This lets me and others know that cog is already being ported. If you're unsure which cogs have been ported (or are already being ported), check the pull requests with the type/port label. Make sure to check both open AND closed PRs.

The list of cogs that are NOT to be ported:

  • hub
  • links
  • poll
  • role
  • role2
  • support

This is because the planned reimplementation of the cog is too different from the original, or because the cog is being removed entirely.

If you want to port the misc cog, it should be renamed text. The meta cog is part complete -- feel free to finish it, or have a look at the file for pointers (specifically the /ping, /about and /stats commands).

Using the database

If you need to create a new table for the database, follow the naming convention set out in the data/static/build.sql file.

The database utility is now very different. Examples below:

# Inserting data (from plugin)
await plugin.bot.d.db.execute("INSERT INTO ... VALUES ...", ...)

# Selecting data (from plugin)
row = await plugin.bot.d.db.try_fetch_record("SELECT user_id, points FROM experience WHERE user_id = ?", ...)
print(row.user_id)
print(row.points)

Datetime objects are automatically converted both ways, so fetching a field with a time in it will return a datetime object, and passing a datetime object to execute will insert a string timestamp.

import datetime as dt

expires = await plugin.bot.d.db.try_fetch_field("SELECT expires FROM warnings WHERE user_id = ?")
isinstance(expires, dt.datetime) == True

Note that any method prefixed with try_ could return None.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].