Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds an option to dm help #1856

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e2f4c82
Adds an option to dm help
BabyBoySnow Mar 19, 2019
82d1f02
should probably allow it to actually work
BabyBoySnow Mar 22, 2019
23fc09d
I'm retarded
BabyBoySnow Mar 22, 2019
ba5c12e
log it
BabyBoySnow Apr 13, 2019
dde55ab
fix log, confirm we msged the user
BabyBoySnow Apr 20, 2019
d9be540
Return = delete after safe send = expire
AutumnClove May 3, 2019
5ae445b
Review (#34)
AutumnClove May 8, 2019
fb9e8d0
Update ffmpeg.exe
BabyBoySnow May 8, 2019
10dd522
Merge branch 'patch-1' of https://github.com/AutumnClove/MusicBot int…
BabyBoySnow May 8, 2019
cffa7d5
Allow command to work in dm's
BabyBoySnow May 8, 2019
988739f
Merge branch 'review' into patch-1
AutumnClove May 10, 2019
dfd652b
only respond if called in server
BabyBoySnow May 10, 2019
87fe44a
better embed handling
BabyBoySnow May 10, 2019
36cbfe3
Merge branch 'review' into patch-1
AutumnClove Jul 14, 2019
ddc1ccf
Merge pull request #41 from Just-Some-Bots/review
AutumnClove Jul 24, 2019
d5b26be
Merge branch 'review' into patch-1
AutumnClove Aug 9, 2019
f3f0b9b
Revert "Merge pull request #41 from Just-Some-Bots/review"
BabyBoySnow Aug 18, 2019
e88e26b
Merge remote-tracking branch 'upstream/review' into review
BabyBoySnow Aug 26, 2019
8b16f0c
Update bot.py
BabyBoySnow Aug 26, 2019
6424fba
actually up to date with review
BabyBoySnow Aug 26, 2019
b313eab
Merge remote-tracking branch 'upstream/review' into review
BabyBoySnow Aug 26, 2019
94b9fd5
Merge branch 'master' into pr/1856
AutumnClove Jun 17, 2021
51b6376
Merge remote-tracking branch 'origin/review' into pr/1856
AutumnClove Jun 17, 2021
14f1e15
Black
BabyBoySnow Aug 20, 2021
56e7762
Merge pull request #43 from Just-Some-Bots/review
AutumnClove Aug 25, 2021
a82d378
.logout -> .close $ asyncio.Task.all_task -> asyncio.all_task
BabyBoySnow Aug 25, 2021
fd3f241
Merge branch 'review' into patch-1
AutumnClove Aug 26, 2021
6ffceea
Blacked
AutumnClove Aug 26, 2021
70645f1
Makes #1856 even to current review
AutumnClove Aug 26, 2021
f5ad301
idk man github desktop doing weird shit
AutumnClove Aug 26, 2021
72cd6d4
Revert "idk man github desktop doing weird shit"
AutumnClove Aug 26, 2021
4607f7f
Merge branch 'patch-1' of https://github.com/AutumnClove/MusicBot int…
AutumnClove Aug 26, 2021
1fec84a
Revert "Merge branch 'patch-1' of https://github.com/AutumnClove/Musi…
AutumnClove Aug 26, 2021
285ef4f
Accidently had another pr in this hoping this fixes?
AutumnClove Aug 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/example_options.ini
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ LeaveServersWithoutOwner = no
# Use command alias defined in aliases.json.
UseAlias = yes

# When enabled the bot will direct message the help menu instead of sending it to a channel.
DMHelp = yes

[Files]
# Path to your i18n file. Do not set this if you do not know what it does.
i18nFile =
9 changes: 7 additions & 2 deletions musicbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,7 @@ async def on_ready(self):
log.info(" Spotify integration: " + ['Disabled', 'Enabled'][self.config._spotify])
log.info(" Legacy skip: " + ['Disabled', 'Enabled'][self.config.legacy_skip])
log.info(" Leave non owners: " + ['Disabled', 'Enabled'][self.config.leavenonowners])
log.info(" Direct message help: " + ['Disabled', 'Enabled'][self.config.dmhelp])

print(flush=True)

Expand Down Expand Up @@ -1140,7 +1141,11 @@ async def cmd_help(self, message, channel, command=None):
if not self.is_all:
desc += self.str.get('cmd-help-all', '\nOnly showing commands you can use, for a list of all commands, run `{}help all`').format(prefix)

return Response(desc, reply=True, delete_after=60)
if self.config.dmhelp:
await self.safe_send_message(message.author, desc, expire_in=60)
jayktaylor marked this conversation as resolved.
Show resolved Hide resolved
return Response(":mailbox_with_mail:", reply=False, expire_in=15)
AutumnClove marked this conversation as resolved.
Show resolved Hide resolved
else:
return Response(desc, reply=True, delete_after=60)

async def cmd_blacklist(self, message, user_mentions, option, something):
"""
Expand Down Expand Up @@ -2636,7 +2641,7 @@ async def on_message(self, message):
return

if isinstance(message.channel, discord.abc.PrivateChannel):
if not (message.author.id == self.config.owner_id and command == 'joinserver'):
if not (message.author.id == self.config.owner_id and command == 'joinserver' or command == 'help'):
await self.safe_send_message(message.channel, 'You cannot use this bot in private messages.')
return

Expand Down
2 changes: 2 additions & 0 deletions musicbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def __init__(self, config_file):
self.legacy_skip = config.getboolean('MusicBot', 'LegacySkip', fallback=ConfigDefaults.legacy_skip)
self.leavenonowners = config.getboolean('MusicBot', 'LeaveServersWithoutOwner', fallback=ConfigDefaults.leavenonowners)
self.usealias = config.getboolean('MusicBot', 'UseAlias', fallback=ConfigDefaults.usealias)
self.dmhelp = config.getboolean('MusicBot', 'DMHelp', fallback=ConfigDefaults.dmhelp)

self.debug_level = config.get('MusicBot', 'DebugLevel', fallback=ConfigDefaults.debug_level)
self.debug_level_str = self.debug_level
Expand Down Expand Up @@ -340,6 +341,7 @@ class ConfigDefaults:
legacy_skip = False
leavenonowners = False
usealias = True
dmhelp = True

options_file = 'config/options.ini'
blacklist_file = 'config/blacklist.txt'
Expand Down