[Core] Embeds toggle for channels. (#3418)

* [Core] Embedset toggle for channels.

* Typo fix

* Add to contact as well

Thanks Jack.

* Add guild only and check.
This commit is contained in:
Stonedestroyer
2020-01-26 18:15:22 +01:00
committed by Michael H
parent de4804863a
commit 41fdcb2ae8
3 changed files with 36 additions and 1 deletions

View File

@@ -121,6 +121,7 @@ class RedBase(commands.GroupMixin, BotBase, RPCMixin): # pylint: disable=no-mem
autoimmune_ids=[],
)
self._config.register_channel(embeds=None)
self._config.register_user(embeds=None)
self._config.init_custom(CUSTOM_GROUPS, 2)
@@ -622,6 +623,9 @@ class RedBase(commands.GroupMixin, BotBase, RPCMixin): # pylint: disable=no-mem
if user_setting is not None:
return user_setting
else:
channel_setting = await self._config.channel(channel).embeds()
if channel_setting is not None:
return channel_setting
guild_setting = await self._config.guild(channel.guild).embeds()
if guild_setting is not None:
return guild_setting