Skip to content

Commit 3ad9014

Browse files
committed
Rename, fun cog and bug fixes
In this update: - Renamed the bot from "Ultimate Bot Core" to "Beep Boop Bot" - The fun cog is finnaly being used, more commands may come soon. - The bot was litrary useless before but now it's fixed and all cogs work.
1 parent ccd2447 commit 3ad9014

6 files changed

Lines changed: 75 additions & 23 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33

44
# Getting Started
55
* **[Setting up the bot](https://github.com/NeilDevolopment/UltimateCoreBot/wiki/Setup)**
6-
* **[Updating the bot](https://github.com/NeilDevolopment/UltimateCoreBot/wiki/Updating)**
7-
* [Configuration](https://github.com/NeilDevolopment/UltimateCoreBot/wiki/Configuration)
6+
* **[Configuration](https://github.com/NeilDevolopment/UltimateCoreBot/wiki/Configuration)**
87
* [Commands](https://github.com/NeilDevolopment/UltimateCoreBot/wiki/Commands)

bot.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from dotenv import load_dotenv
44
import os
55

6-
print("------------------------------")
7-
print("Ultimate Core Bot is starting.")
8-
print("------------------------------")
6+
print("--------------------------")
7+
print("Beep Boop Bot is starting.")
8+
print("--------------------------")
99
print("Loading ENV file.")
1010
load_dotenv()
1111
token = os.getenv("TOKEN")
@@ -15,21 +15,22 @@
1515
print("Loaded ENV file.")
1616

1717
client = commands.Bot(command_prefix=prefix)
18+
client.remove_command('help')
1819

1920
@client.event
2021
async def on_connect():
2122
print("Connected to discord.")
2223

2324
@client.event
2425
async def on_ready():
25-
print("---------------------------")
26-
print("Ultimate Core Bot is ready.")
27-
print("---------------------------")
26+
print("-----------------------")
27+
print("Beep Boop Bot is ready.")
28+
print("-----------------------")
2829

30+
print("Loading cogs")
2931
for filename in os.listdir('./cogs'):
30-
print("Loading cogs")
31-
if filename.endswith(".py"):
32-
client.load_extension(f'cogs.{filename[:-3]}')
33-
print(f"\"{filename[:-3]}\" cog has been loaded.")
32+
if filename.endswith(".py"):
33+
client.load_extension(f'cogs.{filename[:-3]}')
34+
print(f"\"{filename[:-3]}\" cog has been loaded.")
3435

3536
client.run(token)

cogs/fun.py

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,61 @@
1+
import discord
12
from discord.ext import commands
3+
import random
4+
import asyncio
25

36
class Fun(commands.Cog):
47

58
def __init__(self, client):
69
self.bot = client
710

8-
# Comming soon.
11+
@commands.command(aliases=['8ball', '8BALL'])
12+
async def _8ball(self, ctx, *, question):
13+
responses = ["It is certain.",
14+
"It is decidedly so.",
15+
"Without a doubt.",
16+
"Yes - definitely.",
17+
"You may rely on it.",
18+
"As I see it, yes.",
19+
"Most likely.",
20+
"Outlook good.",
21+
"Yes.",
22+
"Signs point to yes.",
23+
"Reply hazy, try again.",
24+
"Ask again later."
25+
"Better not tell you now.",
26+
"Cannot predict now.",
27+
"Concentrate and ask again.",
28+
"Don't count on it.",
29+
"My reply is no.",
30+
"My sources say no.",
31+
"Outlook not so good.",
32+
"Very doubtful."]
33+
em = discord.Embed(title='Magic 8ball!',
34+
colour=discord.Colour.blue())
35+
em.add_field(name=f"**Question:** {question}",
36+
value=f"**Answer:** {random.choice(responses)}")
37+
await ctx.send(embed=em)
38+
39+
@commands.command()
40+
async def count(self, ctx, channel: discord.TextChannel = None):
41+
channel = channel or ctx.channel
42+
messages = await channel.history(limit=None).flatten()
43+
count = len(messages)
44+
embed = discord.Embed(
45+
title="Total Messages",
46+
colour=0x2859b8,
47+
description=f"There were {count} messages in {channel.mention}")
48+
await ctx.send(embed=embed)
49+
50+
@commands.command()
51+
async def flip(self, ctx):
52+
choices = ["Heads", "Tails"]
53+
rancoin = random.choice(choices)
54+
e = discord.Embed(title="Rolling...", color=discord.Color.blue())
55+
msg = await ctx.send(embed=e)
56+
await asyncio.sleep(3)
57+
e = discord.Embed(title=f"{rancoin}", color=discord.Color.blue())
58+
await msg.edit(embed=e)
959

1060
def setup(client):
1161
client.add_cog(Fun(client))

cogs/giveaway.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import discord
12
from discord.ext import commands
23
import os
34
import random
@@ -27,7 +28,6 @@ def convert(time):
2728
return val * time_dict[unit]
2829

2930
@commands.command()
30-
@commands.has_role()
3131
async def giveaway(ctx):
3232
await ctx.send("Let's start with this giveaway! Answer these questions within 15 seconds!")
3333

cogs/info.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1+
import discord
12
from discord.ext import commands
23

34
class Info(commands.Cog):
45

56
def __init__(self, client):
67
self.bot = client
78

8-
@commands.command()
9-
async def help(ctx):
10-
e = discord.Embed(title="BeepBoop Bot Help")
11-
e.add_field(name="Docs", description="[Click here!](https://github.com/NeilDevolopment/BeepBoopBot/wiki)")
12-
e.add_field(name="Commands", description="[Click here!](https://github.com/NeilDevolopment/BeepBoopBot/wiki/Commands)")
13-
await ctx.send(embed=e)
9+
@commands.command()
10+
async def help(self, ctx):
11+
e = discord.Embed(title="BeepBoop Bot Help")
12+
e.add_field(name="Docs", value="[Click here!](https://github.com/NeilDevolopment/BeepBoopBot/wiki)")
13+
e.add_field(name="Commands", value="[Click here!](https://github.com/NeilDevolopment/BeepBoopBot/wiki/Commands)")
14+
await ctx.send(embed=e)
1415

15-
@commands.command()
16-
async def version(ctx):
17-
await ctx.send("Running version 0.6 of BeepBoop Bot.")
16+
@commands.command()
17+
async def version(self, ctx):
18+
await ctx.send("Running version 0.6 of BeepBoop Bot.")
1819

1920
def setup(client):
2021
client.add_cog(Info(client))

cogs/moderation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import discord
12
from discord.ext import commands
23
import os
34
from dotenv import load_dotenv

0 commit comments

Comments
 (0)