43 Commits
Author SHA1 Message Date
rich dca02881c8 Changed uptime output to WW:DD:HH:MM:SS 2020-03-29 17:39:45 -04:00
rich fabd6efe69 updating help details 2020-03-29 17:28:11 -04:00
rich fe2d9c21d3 added $uptime to help command 2020-03-29 17:21:08 -04:00
rich 582a5c05e6 added week/day/hour... text back 2020-03-29 17:19:10 -04:00
rich 1be37c1b4d replaced minute w/ second for second variable 2020-03-29 17:18:09 -04:00
rich f45e3d654a convert to int 2020-03-29 17:16:51 -04:00
rich 8204d41193 Added uptime command 2020-03-29 17:12:32 -04:00
rich 5f3a1a9f3f increased to 1 second 2020-03-29 16:50:21 -04:00
rich 13d9bad9e6 added half second pause between joining channel and playing sound 2020-03-29 16:48:19 -04:00
rich 1c7e26b26e syntax problemo 2020-03-22 16:02:48 -04:00
rich 5cc9d98475 Setting as global 2020-03-22 15:59:50 -04:00
rich 46d3b7b95c fixed grammar 2020-03-22 15:44:26 -04:00
rich 13ec709616 Added command to display real error message. Also udpated help output. 2020-03-22 15:40:25 -04:00
Cooper Nance f1dc6e2975 Removed Dice Stuff. My Bad. 2020-03-21 19:55:24 -04:00
Cooper Nance 4cf2cb0864 Help Typo 2020-03-21 17:51:48 -04:00
Cooper Nance d34a8e5387 Troubleshooting on Prod. What could go wrong! 2020-03-21 17:48:52 -04:00
Cooper Nance 8814ac1013 Added Help 2020-03-21 17:30:23 -04:00
Cooper Nance e3c197e22b Added Dice Roll. 2020-03-21 17:25:24 -04:00
rich efbdcace68 fixed type 2020-03-17 14:21:03 -04:00
rich 23c0343917 added playtime variable 2020-03-17 14:19:47 -04:00
rich e9a72ae15c extended time 2020-03-17 14:15:26 -04:00
rich ef77651512 added eia command and soundfile 2020-03-17 14:10:03 -04:00
rich e62bc7ea36 Merge branch 'master' into 'dev'
Master

See merge request Bots/r0b3BOT!45
2020-02-28 13:53:28 -05:00
rich bc10fac9f0 Merge branch 'master' of http://gitlab.rickelobe.com/Bots/r0b3BOT 2020-02-28 13:52:15 -05:00
rich 81deee6692 corrected missing var 2020-02-28 13:52:04 -05:00
rich b44075c37d Merge branch 'dev' into 'master'
Dev

See merge request Bots/r0b3BOT!44
2020-02-28 13:45:10 -05:00
rich 99a6d362d5 Added aww cmd to play Awww_Bitch.mp3 2020-02-28 13:43:17 -05:00
rich 4bd4bf56d3 Adding Awww_Bitch.mp3 2020-02-28 13:39:11 -05:00
rich 9be971ce64 changed unknown w/ 999 and added if statement to change status accordingly 2019-12-10 22:14:30 -05:00
rich efc899be71 reverting the if statement outside the while - this seemed to have been working 2019-12-10 22:06:01 -05:00
rich 277c3b3b36 fixing str int error when comparing unknown to 5 2019-12-10 22:03:09 -05:00
rich e4c69be8f2 Merge branch 'dev' into 'master'
Feature Request #4 completed, requesting merge into master

See merge request Bots/r0b3BOT!43
2019-12-06 08:38:21 -05:00
rich 1fe66ee2da Feature Request #4 completed, requesting merge into master 2019-12-06 08:38:21 -05:00
rich 96ea3cf3f3 Merge branch '4-users-are-requesting-a-command-to-display-smudge-in-chat' into 'dev'
changed filename to smudge.png

Closes #4

See merge request Bots/r0b3BOT!42
2019-12-06 08:32:18 -05:00
rich 503117f242 changed filename to smudge.png 2019-12-06 08:31:52 -05:00
rich 57bd92cc7d Merge branch '4-users-are-requesting-a-command-to-display-smudge-in-chat' into 'dev'
shrunk image, added file name, removed comment

Closes #4

See merge request Bots/r0b3BOT!41
2019-12-06 08:28:00 -05:00
rich 298eed22cc shrunk image, added file name, removed comment 2019-12-06 08:27:22 -05:00
rich 5005602292 Merge branch '4-users-are-requesting-a-command-to-display-smudge-in-chat' into 'dev'
fixed misuse of function

Closes #4

See merge request Bots/r0b3BOT!40
2019-12-06 08:17:12 -05:00
rich 66472f0f06 fixed misuse of function 2019-12-06 08:16:13 -05:00
rich 2a79e312be Merge branch '4-users-are-requesting-a-command-to-display-smudge-in-chat' into 'dev'
Resolve "Users are requesting a command to display Smudge in chat"

Closes #4

See merge request Bots/r0b3BOT!39
2019-12-06 08:09:51 -05:00
rich 248e598f77 adding smudge command and image 2019-12-06 08:06:39 -05:00
rich bb265b750e Merge branch 'dev' into 'master'
only deploy when merged w/ dev and master branches

See merge request Bots/r0b3BOT!38
2019-12-05 23:08:38 -05:00
rich 97a71f2bda only deploy when merged w/ dev and master branches 2019-12-05 23:06:49 -05:00
5 changed files with 85 additions and 21 deletions

No files matched your search

+3
View File
@@ -4,3 +4,6 @@ stages:
deploy:
stage: deploy
script: /var/lib/gitlab-runner/deploy_r0b3bot.sh
only:
- dev
- master
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+82 -21
View File
@@ -19,9 +19,16 @@ import asyncio
bot = commands.Bot(command_prefix='$', description='A derpy derp of a bot.')
#Record the time the bot started
start_time = time.time()
config = configparser.RawConfigParser()
configFilePath = r'bot_config.conf'
# Last error message variable used by $last_error command to display in discord
global last_error
last_error = "No errors been recorded."
try:
config.read(configFilePath)
except:
@@ -72,11 +79,34 @@ async def on_command_error(ctx, error):
if isinstance(error, commands.CommandInvokeError):
print(" - ERROR: encountered 'CommandInvokeError'")
print(f" - Dumping error: {error}")
last_error = error
await ctx.send("Error, unable to complete your request.")
else:
print('Oopsie, I found an error...')
print(f"Error: {error}")
last_error = error
#
# Debug commands
#
@bot.command()
async def last_error(ctx):
await ctx.send(f"Last error recorded: {last_error}")
@bot.command()
async def uptime(ctx):
# Displays how long the bot has been online
second = time.time() - start_time
minute, second = divmod(second, 60)
hour, minute = divmod(minute, 60)
day, hour = divmod(hour, 24)
week, day = divmod(day, 7)
week = int(week)
day = int(day)
hour = int(hour)
minute = int(minute)
second = int(second)
await ctx.send(f"Uptime [WW:DD:HH:MM:SS]: {week:02d}:{day:02d}:{hour:02d}:{minute:02d}:{second:02d}")
#
# Giphy Commands
@@ -95,6 +125,15 @@ async def holyshit(ctx):
###
#
# Image Commands
#
@bot.command()
async def smudge(ctx):
print(" - Uploading Smudge to chat channel")
file = discord.File("./images/smudge.png", filename="smudge.png")
await ctx.send(file=file)
#
# Voice Commands
#
@@ -105,7 +144,7 @@ async def bitch(ctx, member : discord.Member="NONE"):
datestring = datetime.now()
datestring = datestring.strftime("%m/%d/%Y-%H:%M:%S")
if ctx.message.channel.is_nsfw():
await play_sound(ctx, member, "./sounds/monkey_bitch.mp3", "$bitch")
await play_sound(ctx, member, "./sounds/monkey_bitch.mp3", "$bitch", 5)
else:
print(f"[{datestring}]: {ctx.message.author.display_name} called $bitch, but is not in a NSFW channel")
await ctx.send("This command is too explicit for you!")
@@ -113,7 +152,7 @@ async def bitch(ctx, member : discord.Member="NONE"):
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
async def cowbell(ctx, member : discord.Member="NONE"):
await play_sound(ctx, member, "./sounds/More_cowbell.mp3", "$cowbell")
await play_sound(ctx, member, "./sounds/More_cowbell.mp3", "$cowbell", 5)
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
@@ -121,7 +160,7 @@ async def boom(ctx, member : discord.Member="NONE"):
datestring = datetime.now()
datestring = datestring.strftime("%m/%d/%Y-%H:%M:%S")
if ctx.message.channel.is_nsfw():
await play_sound(ctx, member, "./sounds/BoomBitch.mp3", "$boom")
await play_sound(ctx, member, "./sounds/BoomBitch.mp3", "$boom", 5)
else:
print(f"[{datestring}]: {ctx.message.author.display_name} called $boom, but is not in a NSFW channel")
await ctx.send("This command is too explicit for you!")
@@ -129,27 +168,37 @@ async def boom(ctx, member : discord.Member="NONE"):
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
async def oops(ctx, member : discord.Member="NONE"):
await play_sound(ctx, member, "./sounds/Oops.mp3", "$oops")
await play_sound(ctx, member, "./sounds/Oops.mp3", "$oops", 5)
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
async def trololo(ctx, member : discord.Member="NONE"):
await play_sound(ctx, member, "./sounds/Trololo.mp3", "$trololo")
await play_sound(ctx, member, "./sounds/Trololo.mp3", "$trololo", 5)
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
async def leeroy(ctx, member : discord.Member="NONE"):
await play_sound(ctx, member, "./sounds/leeroy.mp3", "$leeroy")
await play_sound(ctx, member, "./sounds/leeroy.mp3", "$leeroy", 5)
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
async def promoted(ctx, member : discord.Member="NONE"):
await play_sound(ctx, member, "./sounds/Promoted.mp3", "$promoted")
await play_sound(ctx, member, "./sounds/Promoted.mp3", "$promoted", 5)
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
async def wow(ctx, member : discord.Member="NONE"):
await play_sound(ctx, member, "./sounds/wow.mp3", "$wow")
await play_sound(ctx, member, "./sounds/wow.mp3", "$wow", 5)
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
async def aww(ctx, member : discord.Member="NONE"):
await play_sound(ctx, member, "./sounds/Awww_Bitch.mp3", "$aww", 5)
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
async def eia(ctx, member : discord.Member="NONE"):
await play_sound(ctx, member, "./sounds/awesome.mp3", "$eia", 11)
@bot.command()
@commands.cooldown(rate=1, per=10.0, type=commands.BucketType.user)
@@ -163,7 +212,7 @@ async def rs(ctx, member : discord.Member="NONE"):
print(f"[{datestring}]: {ctx.message.author.display_name} called $rs, but is not in a NSFW channel")
await ctx.send("This command is too explicit for you!")
async def play_sound(ctx, member : discord.Member, soundFile, command):
async def play_sound(ctx, member : discord.Member, soundFile, command, playtime):
discord.opus.load_opus("libopus.so")
@@ -210,8 +259,9 @@ async def play_sound(ctx, member : discord.Member, soundFile, command):
print(" - Creating Player")
audio_source = discord.FFmpegPCMAudio(soundFile)
print(f" - Playing {soundFile}")
time.sleep(1)
voice.play(audio_source, after=None)
time.sleep(5)
time.sleep(playtime)
print(f" - Disconnecting from '{channel}'")
await voice.disconnect()
###
@@ -417,12 +467,17 @@ async def updateStatus():
# Try to get the % of Completion
print_completion = round(octoapi.get_completion(), 2)
except:
print_completion = "Unknown"
print_completion = 999
unknowns += 1
#Set the activity to the new percent complete value
activity = discord.Activity(name=f"3D Print @ {str(print_completion)}%",type=discord.ActivityType.watching)
if print_completion != 999:
activity = discord.Activity(name=f"3D Print @ {str(print_completion)}%",type=discord.ActivityType.watching)
else:
activity = discord.Activity(name=f"3D Print @ ERROR",type=discord.ActivityType.watching)
await bot.change_presence(activity=activity)
if (unknowns >= 5):
break
await asyncio.sleep(30)
@@ -460,6 +515,7 @@ async def info(ctx):
bot.remove_command('help')
@bot.command()
async def help(ctx):
embed = discord.Embed(title="R0b3BOT", description="List of commands are:", color=0xeee657)
@@ -468,16 +524,21 @@ async def help(ctx):
embed.add_field(name="$holyshit", value="Displays Marty McFly HOLY SHIT gif", inline=False)
embed.add_field(name="$greetings", value="Gives a nice greet message", inline=False)
embed.add_field(name="$cat", value="Gives a cute cat gif to lighten up the mood.", inline=False)
embed.add_field(name="$bitch @member", value="Plays 'monkey_bitch.mp3' to the users voice channel, if no user is specified it will play in your own voice channel", inline=False)
embed.add_field(name="$boom @member", value="Plays 'BoomBitch.mp3' to the users voice channel, if no user is specified it will play in your own voice channel", inline=False)
embed.add_field(name="$cowbell @member", value="Plays 'More_cowbell.mp3' to the users voice channel, if no user is specified it will play in your own voice channel", inline=False)
embed.add_field(name="$oops @member", value="Plays 'Oops.mp3' to the users voice channel, if no user is specified it will play in your own voice channel", inline=False)
embed.add_field(name="$promoted @member", value="Plays 'Promoted.mp3' to the users voice channel, if no user is specified it will play in your own voice channel", inline=False)
embed.add_field(name="$trololo @member", value="Plays 'Trololo.mp3' to the users voice channel, if no user is specified it will play in your own voice channel", inline=False)
embed.add_field(name="$leeroy @member", value="Plays 'leeroy.mp3' to the users voice channel, if no user is specified it will play in your own voice channel", inline=False)
embed.add_field(name="$bitch @member", value="Plays clip of BigEric420 saying 'maybe you shouldn't be such a bitch.mp3'", inline=False)
embed.add_field(name="$boom @member", value="Plays 'Boom Bitch' sound clip", inline=False)
embed.add_field(name="$cowbell @member", value="Plays 'SNL More Cowbell' sound clip", inline=False)
embed.add_field(name="$oops @member", value="Plays 'Oops.mp3'", inline=False)
embed.add_field(name="$promoted @member", value="Plays Battlefield Friends 'PROMOTED!' sound clip", inline=False)
embed.add_field(name="$trololo @member", value="Plays a clip of Trololo song", inline=False)
embed.add_field(name="$leeroy @member", value="Plays Leeeerrroooyyy Jenkins clip", inline=False)
embed.add_field(name="$eia @member", value="Plays 'Everything is Awesome' song clip")
embed.add_field(name="$info", value="Gives a little info about the bot", inline=False)
embed.add_field(name="$help", value="Gives this message", inline=False)
embed.add_field(name="$last_error", value="Will display the real error message the bot has last encountered for additional debugging info")
embed.add_field(name="$uptime", value="Displays how long the bot has been up since last service restart")
await ctx.send(embed=embed)
bot.run(DISCORD_AUTH_TOKEN)
embed = discord.Embed(title="A note about sound clips:", description="Sound clips are only played voice channels. If no user is specified when calling the command, the sound will played in the channel the user is currently joined to. When a username is specified, the bot will play the sound in the channel that user is currently in.")
await ctx.send(embed=embed)
bot.run(DISCORD_AUTH_TOKEN)
Binary file not shown.
Binary file not shown.