Edit your Mumble Servers welcome message with mice and a channel as the editor

In this article I already described how to use Mice to manage your Mumble-Server.

Thats what I use instead of an admin interface.

But this is very unhandy if you want to change the welcome message (internally called welcometext) of your server because pasting much HTML code into an interactive Python shell does not work well.

But one can use a trick: Load the current welcometext into a channel description, edit it with the channel editor and write it back.

In order to do that create a new channel, temporary or permanent. Then edit it and note the channel id you can see behind the channel name which is 4268 in this case:

mumble_channel_editor

Close the editor. Don’t leave the channel if it is a temporary one.

Start mice as described here and get your server as an object, the first created server has the ID 1:

s1=mice.m.getServer(1)

Now set the current welcometext as the channel description of your new channel:

channel=s1.getChannelState(4268)
channel.description=s1.getConf("welcometext")
s1.setChannelState(channel)

Open the channel editor again to be able to change the channel description:

mumble_channel_editor_with_welcometext

When editing is done close the editor with „OK“ and then write back the welcometext (note that the following code is one line only):

s1.setConf("welcometext", s1.getChannelState(4268).description)

The server sends the new welcome message instantly to all clients.

The drawback of this method is that some styles are filtered out when pressing OK which would work editing the welcometext directly. For example I cannot align paragraphs to the center in my case.

Another method editing the welcometext is with the help of a text file which I will describe later :)

Ähnliche Themen …